longhuanlin/multipart-stream/model does not have a README file

    MultipartError

    pub(all) suberror MultipartError {
    InvalidContentType(reason~ : String)
    InvalidBoundary(reason~ : String)
    MalformedHeader(part_index~ : Int, reason~ : String)
    MissingDisposition(part_index~ : Int)
    MissingName(part_index~ : Int)
    UnexpectedEof(phase~ : ParserPhase, offset~ : Int64)
    LimitExceeded(kind~ : LimitKind, limit~ : Int64, observed~ : Int64)
    InvalidState(operation~ : String, phase~ : ParserPhase)
    BoundaryCollision(part_index~ : Int)
    BodyLengthMismatch(part_index~ : Int, expected~ : Int64, observed~ : Int64)
    Unsupported(feature~ : String)
    } derive(Eq,
    Debug
    )

    Exact protocol, resource, and lifecycle failures.

    HeaderField

    pub(all) struct HeaderField {
    name : String
    value : String
    } derive(Eq,
    Debug
    )

    One part header. Header names are normalized to lowercase while values remain untrusted protocol text.

    LimitKind

    pub(all) enum LimitKind {
    TotalBytes
    Parts
    HeadersPerPart
    HeaderBytes
    HeaderLineBytes
    PartBytes
    } derive(Eq,
    Debug
    )

    Resource dimension that exceeded its configured limit.

    Limits

    pub(all) struct Limits {
    max_total_bytes : Int64
    max_parts : Int
    max_headers_per_part : Int
    max_header_bytes : Int
    max_header_line_bytes : Int
    max_part_bytes : Int64
    } derive(Eq,
    Debug
    )

    Parser and writer resource limits. All limits are hard, fail-closed boundaries; exceeding one must not produce a successful message.

    MediaType

    pub(all) struct MediaType {
    media_type : String
    boundary : String
    parameters : Array[Parameter]
    } derive(Eq,
    Debug
    )

    Parsed multipart/form-data Content-Type.

    MultipartDiagnostic

    pub(all) struct MultipartDiagnostic {
    code : String
    phase : ParserPhase?
    offset : Int64?
    part_index : Int?
    limit_kind : LimitKind?
    limit : Int64?
    observed : Int64?
    } derive(Eq,
    Debug
    )

    A stable, redacted view of a protocol error for logs and metrics.

    MultipartEvent

    pub(all) enum MultipartEvent {
    PartBegin(PartMeta)
    PartData(Bytes)
    PartEnd(Int)
    MessageEnd
    } derive(Eq,
    Debug
    )

    Ordered, binary-safe parser output.

    Parameter

    pub(all) struct Parameter {
    name : String
    value : String
    } derive(Eq,
    Debug
    )

    One media-type parameter after syntactic unquoting.

    ParserPhase

    pub(all) enum ParserPhase {
    Preamble
    Headers
    Body
    Epilogue
    Done
    Failed
    } derive(Eq,
    Debug
    )

    Public lifecycle phase used in deterministic errors and diagnostics.

    ParserStats

    pub(all) struct ParserStats {
    bytes_seen : Int64
    parts_started : Int
    parts_completed : Int
    header_bytes : Int64
    body_bytes : Int64
    events_emitted : Int64
    max_pending_body_bytes : Int
    max_matcher_retained_bytes : Int
    max_buffered_bytes : Int
    } derive(Eq,
    Debug
    )

    Redacted counters for one parser instance.

    The value deliberately contains only counts and byte sizes. It never stores body bytes, header values, field names, or filenames.

    PartMeta

    pub(all) struct PartMeta {
    index : Int
    name : String
    filename : String?
    content_type : String?
    headers : Array[HeaderField]
    } derive(Eq,
    Debug
    )

    Metadata emitted before a part body.

    filename is untrusted metadata and must never be used as a filesystem path without an application-owned policy.

    default_limits

    fn default_limits() -> Limits

    Conservative defaults for examples and initial integrations.

    Applications are expected to choose limits appropriate for their threat model before accepting untrusted uploads.

    redact_error

    fn redact_error(error : MultipartError) -> MultipartDiagnostic

    Convert a protocol error into log-safe structured data.

    Reasons, header values, field names, filenames, and body bytes are never copied into the result.

    validate_limits

    fn validate_limits(limits : Limits) -> Unit raise MultipartError

    Validate a resource-limit configuration before it is attached to a parser or writer. This is public to implementation packages but intentionally is not re-exported by the root facade: applications normally construct a Limits value and pass it to MultipartParser::new or MultipartWriter::new.

    Source Files