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

    UploadError

    pub(all) suberror UploadError {
    InvalidPolicy(reason~ : String)
    Protocol(error~ :
    MultipartError
    )
    Mixed(error~ :
    MixedError
    )
    SinkFailed(operation~ : String)
    PartTooLarge(part_index~ : Int, limit~ : Int64, observed~ : Int64)
    TotalPayloadTooLarge(limit~ : Int64, observed~ : Int64)
    PartCountExceeded(kind~ : UploadPartKind, limit~ : Int, observed~ : Int)
    UnexpectedEvent(reason~ : String)
    Aborted(reason~ : String)
    } derive(Eq,
    Debug
    )

    ActiveDigest

    pub(all) struct ActiveDigest {
    part : UploadPart
    bytes : Int64
    state : Int64
    }

    AuditSummary

    pub(all) struct AuditSummary {
    parts : Int
    payload_bytes : Int64
    combined_crc32 : Int64
    } derive(Eq,
    Debug
    )

    Aggregate redacted integrity data for a completed sequence of parts.

    AuditedSink

    pub struct AuditedSink {
    sink : UploadSink
    audit : UploadAudit
    }

    A transactional sink decorator that records checksums while forwarding all callbacks to an application-owned delegate.

    AuditedSink::digests

    fn AuditedSink::digests(self : AuditedSink) -> Array[PartDigest]

    AuditedSink::new

    fn AuditedSink::new(delegate : UploadSink) -> AuditedSink

    AuditedSink::sink

    fn AuditedSink::sink(self : AuditedSink) -> UploadSink

    AuditedSink::summary

    fn AuditedSink::summary(self : AuditedSink) -> AuditSummary raise UploadError

    MeasuredSink

    pub struct MeasuredSink {
    delegate : UploadSink
    begin_calls : Int
    data_calls : Int64
    end_calls : Int
    commit_calls : Int
    abort_calls : Int
    payload_bytes : Int64
    max_chunk_bytes : Int
    }

    A sink decorator that records callback volume and peak application chunk size while forwarding behavior unchanged to an application-owned sink.

    MeasuredSink::metrics

    fn MeasuredSink::metrics(self : MeasuredSink) -> SinkMetrics

    MeasuredSink::new

    fn MeasuredSink::new(delegate : UploadSink) -> MeasuredSink

    MeasuredSink::sink

    PartDigest

    pub(all) struct PartDigest {
    part : UploadPart
    bytes : Int64
    crc32 : Int64
    } derive(Eq,
    Debug
    )

    One completed-part integrity record. CRC-32 is intentionally exposed as a fast corruption-detection signal, not as a cryptographic digest.

    SinkMetrics

    pub(all) struct SinkMetrics {
    begin_calls : Int
    data_calls : Int64
    end_calls : Int
    commit_calls : Int
    abort_calls : Int
    payload_bytes : Int64
    max_chunk_bytes : Int
    } derive(Eq,
    Debug
    )

    Redacted callback-level measurements for a host storage sink. The values make downstream buffering visible without recording field names, filenames, payload bytes, or sink-specific paths.

    UploadAudit

    pub struct UploadAudit {
    active : ActiveDigest?
    digests : Array[PartDigest]
    payload_bytes : Int64
    combined_state : Int64
    }

    Incremental per-part CRC-32 recorder. It retains no payload bytes and may be used directly or through AuditedSink.

    UploadAudit::begin

    fn UploadAudit::begin(self : UploadAudit, part : UploadPart) -> Unit raise UploadError

    UploadAudit::data

    fn UploadAudit::data(self : UploadAudit, bytes : Bytes) -> Unit raise UploadError

    UploadAudit::digests

    fn UploadAudit::digests(self : UploadAudit) -> Array[PartDigest]

    UploadAudit::end

    fn UploadAudit::end(self : UploadAudit, part : UploadPart) -> Unit raise UploadError

    UploadAudit::new

    UploadAudit::summary

    fn UploadAudit::summary(self : UploadAudit) -> AuditSummary raise UploadError

    UploadPart

    pub(all) struct UploadPart {
    meta :
    PartMeta

    kind : UploadPartKind
    depth : Int
    parent_part_index : Int?
    } derive(Eq,
    Debug
    )

    Metadata supplied to application-owned storage callbacks.

    UploadPartKind

    pub(all) enum UploadPartKind {
    Field
    File
    } derive(Eq,
    Debug
    )

    UploadPipeline

    pub struct UploadPipeline {
    parser :
    MultipartParser

    mixed :
    MixedStream
    ?
    policy : UploadPolicy
    sink : UploadSink
    active : UploadPart?
    active_bytes : Int64
    payload_bytes : Int64
    fields_started : Int
    files_started : Int
    fields_completed : Int
    files_completed : Int
    completed : Bool
    aborted : Bool
    }

    UploadPipeline::cancel

    fn UploadPipeline::cancel(self : UploadPipeline, reason~ : String) -> Unit

    Terminate an in-flight transaction because the host source or request lifecycle ended outside the multipart protocol. Repeated cancellation is idempotent and never calls the sink's abort callback more than once.

    UploadPipeline::feed

    fn UploadPipeline::feed(self : UploadPipeline, chunk : Bytes) -> Unit raise UploadError

    Feed a network, file, or application-owned chunk into the upload pipeline.

    UploadPipeline::finish

    Complete the parser and atomically commit the host application's sink.

    UploadPipeline::new

    fn UploadPipeline::new(boundary : String, sink : UploadSink, policy? : UploadPolicy) -> UploadPipeline raise UploadError

    UploadPipeline::parser_stats

    Return parser resource statistics for host-side metrics and admission logs.

    UploadPipeline::progress

    UploadPolicy

    pub(all) struct UploadPolicy {
    parser_limits :
    Limits

    allow_legacy_mixed : Bool
    max_file_bytes : Int64
    max_field_bytes : Int64
    max_total_payload_bytes : Int64
    max_file_count : Int
    max_field_count : Int
    } derive(Eq,
    Debug
    )

    Application policy for the zero-dependency upload pipeline.

    UploadProgress

    pub(all) struct UploadProgress {
    wire_bytes : Int64
    payload_bytes : Int64
    fields_completed : Int
    files_completed : Int
    active_part : UploadPart?
    } derive(Eq,
    Debug
    )

    UploadReceipt

    pub(all) struct UploadReceipt {
    wire_bytes : Int64
    payload_bytes : Int64
    fields_completed : Int
    files_completed : Int
    } derive(Eq,
    Debug
    )

    UploadSink

    pub struct UploadSink {
    on_begin : (UploadPart) -> Result[Unit, UploadError]
    on_data : (UploadPart, Bytes) -> Result[Unit, UploadError]
    on_end : (UploadPart) -> Result[Unit, UploadError]
    on_commit : (UploadReceipt) -> Result[Unit, UploadError]
    on_abort : (UploadError) -> Unit
    }

    Transactional callbacks owned by the host application. The pipeline never chooses paths or opens files; a sink may stream bytes to disk, object storage, a hash calculator, or an in-memory test collector.

    UploadSink::new

    fn UploadSink::new(on_begin : (UploadPart) -> Result[Unit, UploadError], on_data : (UploadPart, Bytes) -> Result[Unit, UploadError], on_end : (UploadPart) -> Result[Unit, UploadError], on_commit : (UploadReceipt) -> Result[Unit, UploadError], on_abort : (UploadError) -> Unit) -> UploadSink

    crc32_finish

    fn crc32_finish(state : Int64) -> Int64

    Finalize an incremental CRC-32 state into its conventional unsigned value.

    crc32_initial

    fn crc32_initial() -> Int64

    Start an incremental CRC-32 state.

    crc32_update

    fn crc32_update(state : Int64, bytes : Bytes) -> Int64

    Advance a CRC-32 state with binary-safe data.

    default_upload_policy

    fn default_upload_policy() -> UploadPolicy