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::equal

    fn MimeError::equal(MimeError, MimeError) -> Bool

    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.

    MimeError::not_equal

    fn MimeError::not_equal(x : MimeError, y : MimeError) -> Bool

    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.

    Attachment::equal

    fn Attachment::equal(Attachment, Attachment) -> Bool

    Attachment::not_equal

    fn Attachment::not_equal(x : Attachment, y : Attachment) -> Bool

    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::equal

    fn ByteRange::equal(ByteRange, ByteRange) -> Bool

    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::not_equal

    fn ByteRange::not_equal(x : ByteRange, y : ByteRange) -> Bool

    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::equal

    ContentDisposition::not_equal

    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::equal

    DiagnosticCode::not_equal

    fn DiagnosticCode::not_equal(x : DiagnosticCode, y : DiagnosticCode) -> Bool

    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.

    DiagnosticLevel::equal

    DiagnosticLevel::not_equal

    fn DiagnosticLevel::not_equal(x : DiagnosticLevel, y : DiagnosticLevel) -> Bool

    EntityKind

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

    Structural interpretation of one MIME Entity body.

    EntityKind::equal

    fn EntityKind::equal(EntityKind, EntityKind) -> Bool

    EntityKind::not_equal

    fn EntityKind::not_equal(x : EntityKind, y : EntityKind) -> Bool

    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::equal

    fn HeaderBlock::equal(HeaderBlock, HeaderBlock) -> Bool

    HeaderBlock::first

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

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

    HeaderBlock::not_equal

    fn HeaderBlock::not_equal(x : HeaderBlock, y : HeaderBlock) -> Bool

    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.

    HeaderField::equal

    fn HeaderField::equal(HeaderField, HeaderField) -> Bool

    HeaderField::not_equal

    fn HeaderField::not_equal(x : HeaderField, y : HeaderField) -> Bool

    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.

    InternetMessage::equal

    InternetMessage::not_equal

    fn InternetMessage::not_equal(x : InternetMessage, y : InternetMessage) -> Bool

    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.

    MediaParameter::equal

    MediaParameter::not_equal

    fn MediaParameter::not_equal(x : MediaParameter, y : MediaParameter) -> Bool

    MediaType

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

    Parsed MIME media type and ordered parameters.

    MediaType::equal

    fn MediaType::equal(MediaType, MediaType) -> Bool

    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::not_equal

    fn MediaType::not_equal(x : MediaType, y : MediaType) -> Bool

    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::equal

    fn MimeEntity::equal(MimeEntity, MimeEntity) -> Bool

    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.

    MimeEntity::not_equal

    fn MimeEntity::not_equal(x : MimeEntity, y : MimeEntity) -> Bool

    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.

    ParseDiagnostic::equal

    ParseDiagnostic::not_equal

    fn ParseDiagnostic::not_equal(x : ParseDiagnostic, y : ParseDiagnostic) -> Bool

    ParseMode

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

    Parser behavior selected for non-standard but recognizable input.

    ParseMode::equal

    fn ParseMode::equal(ParseMode, ParseMode) -> Bool

    ParseMode::not_equal

    fn ParseMode::not_equal(x : ParseMode, y : ParseMode) -> Bool

    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.

    ParseStats::equal

    fn ParseStats::equal(ParseStats, ParseStats) -> Bool

    ParseStats::not_equal

    fn ParseStats::not_equal(x : ParseStats, y : ParseStats) -> Bool

    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::equal

    ResourceLimits::not_equal

    fn ResourceLimits::not_equal(x : ResourceLimits, y : ResourceLimits) -> Bool

    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.

    TextSelection::equal

    TextSelection::not_equal

    fn TextSelection::not_equal(x : TextSelection, y : TextSelection) -> Bool

    TransferEncoding

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

    Standard and extension content-transfer encodings.

    TransferEncoding::equal

    TransferEncoding::not_equal

    fn TransferEncoding::not_equal(x : TransferEncoding, y : TransferEncoding) -> Bool

    TransferEncoding::to_string

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

    Canonical lower-case spelling for reports.