oyjh0381/moonmime/model does not have a README file

    MimeError

    pub(all) suberror MimeError {
    InvalidArgument(String)
    InputTooLarge(Int, Int)
    HeaderSectionTooLarge(Int, Int)
    HeaderLineTooLong(Int, Int)
    HeaderCountExceeded(Int, Int)
    MalformedHeader(Int, String)
    MissingHeaderTerminator(Int)
    InvalidMediaType(String)
    InvalidDisposition(String)
    InvalidParameter(String)
    InvalidBoundary(String)
    MissingBoundary(String)
    MissingClosingBoundary(String)
    RecursionLimitExceeded(Int, Int)
    EntityCountExceeded(Int, Int)
    LeafBodyTooLarge(Int, Int)
    DecodedOutputTooLarge(Int, Int)
    InvalidBase64(Int, String)
    InvalidQuotedPrintable(Int, String)
    UnsupportedTransferEncoding(String)
    UnsupportedCharset(String)
    InvalidEncodedWord(String)
    InvalidByteRange(Int, Int, Int)
    IoFailure(String)
    } derive(Eq,
    Debug
    )

    Stable error categories exposed by MoonMIME.

    MimeError::code

    fn MimeError::code(self : MimeError) -> String

    Stable machine-readable category for automation and CLI clients.

    MimeError::exit_code

    fn MimeError::exit_code(self : MimeError) -> Int

    Process exit status used by the reference command line program.

    MimeError::message

    fn MimeError::message(self : MimeError) -> String

    Human-readable detail for a structured failure.

    Attachment

    pub(all) struct Attachment {
    path : Array[Int]
    filename : String?
    media_type : String
    disposition : String?
    transfer_encoding : String
    raw_size : Int
    explicit : Bool
    } derive(Eq,
    Debug
    )

    Metadata returned when enumerating attachment candidates.

    ByteRange

    pub(all) struct ByteRange {
    start : Int
    end : Int
    } derive(Eq,
    Debug
    )

    Half-open byte range into an Internet Message's Raw Representation.

    ByteRange::contains

    fn ByteRange::contains(self : ByteRange, offset : Int) -> Bool

    Whether an absolute byte offset lies within this half-open range.

    ByteRange::is_empty

    fn ByteRange::is_empty(self : ByteRange) -> Bool

    Whether the range contains no bytes.

    ByteRange::length

    fn ByteRange::length(self : ByteRange) -> Int

    Number of bytes covered by the range.

    ByteRange::new

    fn ByteRange::new(start : Int, end : Int) -> ByteRange raise MimeError

    Construct a range after validating monotonic non-negative bounds.

    ByteRange::trusted

    fn ByteRange::trusted(start : Int, end : Int) -> ByteRange

    Construct a range known to have already been validated by the parser.

    ByteRange::validate

    fn ByteRange::validate(self : ByteRange, input_length : Int) -> Unit raise MimeError

    Verify that the range can safely slice an input of input_length bytes.

    ContentDisposition

    pub(all) struct ContentDisposition {
    kind : String
    parameters : Array[MediaParameter]
    } derive(Eq,
    Debug
    )

    Content-Disposition and its ordered parameters.

    ContentDisposition::parameter

    fn ContentDisposition::parameter(self : ContentDisposition, lower_name : StringView) -> String?

    Return the last parameter with a normalized name.

    DiagnosticCode

    pub(all) enum DiagnosticCode {
    BareLineFeed
    BareCarriageReturn
    HeaderWhitespaceBeforeColon
    HeaderWithoutColon
    ContinuationWithoutField
    NonAsciiHeaderName
    DuplicateSingletonHeader
    InvalidEncodedWordPreserved
    UnknownTransferEncodingPreserved
    InvalidParameterPreserved
    MissingMultipartPreambleBreak
    TrailingBytesAfterBoundary
    MissingClosingBoundaryAccepted
    UnsupportedCharsetPreserved
    } derive(Eq,
    Debug
    )

    Machine-stable diagnostic codes returned in compatible mode.

    DiagnosticCode::to_code

    fn DiagnosticCode::to_code(self : DiagnosticCode) -> String

    Stable textual spelling used by JSON and CLI reports.

    DiagnosticLevel

    pub(all) enum DiagnosticLevel {
    Warning
    Info
    } derive(Eq,
    Debug
    )

    Severity of a non-fatal parse observation.

    EntityKind

    pub(all) enum EntityKind {
    Leaf
    Multipart
    EmbeddedMessage
    } derive(Eq,
    Debug
    )

    Structural interpretation of one MIME Entity body.

    HeaderBlock

    pub(all) struct HeaderBlock {
    fields : Array[HeaderField]
    range : ByteRange
    body_start : Int
    } derive(Eq,
    Debug
    )

    Ordered fields and their exact source region.

    HeaderBlock::all

    fn HeaderBlock::all(self : HeaderBlock, lower_name : StringView) -> Array[HeaderField]

    Return every matching field without losing original order.

    HeaderBlock::contains

    fn HeaderBlock::contains(self : HeaderBlock, lower_name : StringView) -> Bool

    Whether at least one field with the requested normalized name exists.

    HeaderBlock::first

    fn HeaderBlock::first(self : HeaderBlock, lower_name : StringView) -> HeaderField?

    Return the first field whose name matches ASCII case-insensitively.

    HeaderField

    pub(all) struct HeaderField {
    name : String
    lower_name : String
    value : String
    field_range : ByteRange
    value_range : ByteRange
    line_count : Int
    } derive(Eq,
    Debug
    )

    One ordered header field with normalized lookup name and unfolded value.

    InternetMessage

    pub(all) struct InternetMessage {
    raw : Bytes
    root : MimeEntity
    diagnostics : Array[ParseDiagnostic]
    stats : ParseStats
    } derive(Eq,
    Debug
    )

    Full parsed message, retaining exact input bytes and all diagnostics.

    MediaParameter

    pub(all) struct MediaParameter {
    name : String
    lower_name : String
    value : String
    extended : Bool
    section : Int?
    encoded : Bool
    } derive(Eq,
    Debug
    )

    Ordered media parameter preserving its original name and decoded value.

    MediaType

    pub(all) struct MediaType {
    top_level : String
    subtype : String
    parameters : Array[MediaParameter]
    } derive(Eq,
    Debug
    )

    Parsed MIME media type and ordered parameters.

    MediaType::essence

    fn MediaType::essence(self : MediaType) -> String

    Lowercase type/subtype spelling.

    MediaType::is_message_rfc822

    fn MediaType::is_message_rfc822(self : MediaType) -> Bool

    Whether this entity carries an embedded Internet Message.

    MediaType::is_multipart

    fn MediaType::is_multipart(self : MediaType) -> Bool

    Whether this media type is a multipart container.

    MediaType::parameter

    fn MediaType::parameter(self : MediaType, lower_name : StringView) -> String?

    Return the last parameter with a normalized name.

    MediaType::text_plain

    fn MediaType::text_plain() -> MediaType

    Default media type for a MIME entity with no Content-Type field.

    MimeEntity

    pub(all) struct MimeEntity {
    path : Array[Int]
    depth : Int
    headers : HeaderBlock
    media_type : MediaType
    disposition : ContentDisposition?
    transfer_encoding : TransferEncoding
    kind : EntityKind
    entity_range : ByteRange
    body_range : ByteRange
    preamble_range : ByteRange?
    epilogue_range : ByteRange?
    children : Array[MimeEntity]
    } derive(Eq,
    Debug
    )

    One byte-preserving entity in the recursive MIME tree.

    MimeEntity::filename

    fn MimeEntity::filename(self : MimeEntity) -> String?

    Filename parameter without applying filesystem path semantics.

    MimeEntity::is_explicit_attachment

    fn MimeEntity::is_explicit_attachment(self : MimeEntity) -> Bool

    Whether Content-Disposition explicitly marks this entity as an attachment.

    ParseDiagnostic

    pub(all) struct ParseDiagnostic {
    level : DiagnosticLevel
    code : DiagnosticCode
    message : String
    range : ByteRange
    entity_path : Array[Int]
    } derive(Eq,
    Debug
    )

    Structured observation about accepted non-standard input.

    ParseMode

    pub(all) enum ParseMode {
    Strict
    Compatible
    } derive(Eq,
    Debug
    )

    Parser behavior selected for non-standard but recognizable input.

    ParseStats

    pub(all) struct ParseStats {
    entities : Int
    leaf_entities : Int
    multipart_entities : Int
    embedded_messages : Int
    maximum_depth : Int
    raw_bytes : Int
    } derive(Eq,
    Debug
    )

    Counts accumulated without re-walking the entity tree.

    ResourceLimits

    pub(all) struct ResourceLimits {
    max_input_bytes : Int
    max_header_bytes : Int
    max_header_line_bytes : Int
    max_header_count : Int
    max_depth : Int
    max_entities : Int
    max_leaf_body_bytes : Int
    max_decoded_leaf_bytes : Int
    max_total_decoded_bytes : Int
    max_parameter_count : Int
    max_boundary_bytes : Int
    max_diagnostics : Int
    } derive(Eq,
    Debug
    )

    Resource limits applied before allocating or recursively parsing content.

    ResourceLimits::edge_defaults

    fn ResourceLimits::edge_defaults() -> ResourceLimits

    Tighter settings for small webhook or edge-function payloads.

    ResourceLimits::secure_defaults

    fn ResourceLimits::secure_defaults() -> ResourceLimits

    Conservative defaults suitable for untrusted messages in ordinary tools.

    ResourceLimits::validate

    fn ResourceLimits::validate(self : ResourceLimits) -> Unit raise MimeError

    Validate limit relationships before parsing attacker-controlled input.

    TextSelection

    pub(all) struct TextSelection {
    path : Array[Int]
    media_type : String
    charset : String?
    text : String
    } derive(Eq,
    Debug
    )

    Selected display-body candidate.

    TransferEncoding

    pub(all) enum TransferEncoding {
    SevenBit
    EightBit
    Binary
    Base64
    QuotedPrintable
    Extension(String)
    } derive(Eq,
    Debug
    )

    Standard and extension content-transfer encodings.

    TransferEncoding::to_string

    fn TransferEncoding::to_string(self : TransferEncoding) -> String

    Canonical lower-case spelling for reports.

    Powered by MoonBit

    Site sourceReport issuePackagesBuild queueSkillsStatistics

    © 2026 mooncakes.io