Sign in

    moonrockz/partiql-value/ion does not have a README file

    CodecError

    pub(all) suberror CodecError {
    Unsupported(String)
    Malformed(String)
    } derive(Eq,
    Debug
    )

    Why an Ion value could not be decoded.

    IonDataError

    Errors at the Ion transport boundary. Codec errors retain their distinction between malformed and unsupported PartiQL encodings.

    IonDataError::message

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

    A human-readable message, including every path for schema violations. Use the error variants when a caller needs to distinguish failure kinds.

    Validation

    pub struct Validation {
    // private fields
    }

    A schema applied to raw Ion, before PartiQL decoding.

    Validation::document

    fn Validation::document(schema :
    Schema
    , type_name : String) -> Validation

    Validate a whole datagram using an Ion Schema document type.

    Validation::elements

    fn Validation::elements(schema :
    Schema
    , type_name : String) -> Validation

    Validate every element and collect violations from all elements.

    ValidationViolation

    pub struct ValidationViolation {
    path : String
    message : String
    } derive(
    Debug
    )

    A schema violation with its location in the input datagram.

    from_ion

    Decodes PartiQL-encoded Ion without recursion through containers.

    from_ion_data

    Decodes Ion data in the Ion-preserving mode: the value is boxed, so every Ion detail is kept until a semantic lowers it (ADR 0005).

    load_schema_bytes

    fn load_schema_bytes(source : BytesView, resolver? : (String) -> Array[
    Ion
    ] raise
    IonError
    ) ->
    Schema
    raise IonDataError

    Load an Ion Schema from binary or UTF-8 text. Imports can be resolved by the supplied resolver, just as in the upstream schema loader.

    read_bytes

    fn read_bytes(source : BytesView, catalog? :
    Catalog
    , validation? : Validation) -> Array[
    Value
    ] raise IonDataError

    Detect binary Ion by its version marker, otherwise read strict UTF-8 text.

    test {
    let values = @partiql_ion.read_text("1 $bag::[2, 3]")
    let binary = @partiql_ion.write_bytes(values)
    @expect.expect(@partiql_ion.read_bytes(binary)).to_equal(values)
    }

    read_text

    fn read_text(source : StringView, catalog? :
    Catalog
    , validation? : Validation) -> Array[
    Value
    ] raise IonDataError

    Read a full PartiQL-encoded Ion text datagram. No implicit bag conversion.

    to_ion

    Encodes a value in PartiQL-encoded Ion. A boxed Ion value is written as $ion::x.

    to_ion_data

    Encodes a value for Ion data (the Ion-preserving mode): a boxed Ion value, at any depth, is written exactly as it was read; other values use the PartiQL-encoded forms. Read the output with from_ion_data, not from_ion: a boxed value whose own annotation is, for example, $bag is written as is, so from_ion would read it as a PartiQL bag.

    write_bytes

    fn write_bytes(values : Array[
    Value
    ]) -> Bytes raise IonDataError

    Write a binary datagram with one local symbol table. Unresolved shared symbols retain their import metadata.

    write_text

    fn write_text(values : Array[
    Value
    ], pretty? : Bool) -> String raise IonDataError

    Write one Ion value per line, with a final newline for nonempty datagrams.

    Powered by MoonBit

    Site sourceReport issuePackagesBuild queueSkillsStatistics

    © 2026 mooncakes.io