Skip to main content

MapperError

Enum MapperError 

Source
pub enum MapperError {
    DataDirNotFound {
        path: String,
    },
    BundleNotFound {
        fv: String,
    },
    VariantNotFound {
        fv: String,
        variant: String,
    },
    PidNotFound {
        fv: String,
        variant: String,
        pid: String,
    },
    Assembly(AssemblyError),
    Mapping(MappingError),
    Serialization(String),
    NoMigSchema {
        fv: String,
        variant: String,
    },
    MissingGroupEntrySegment(Box<GroupEntrySegmentError>),
    MalformedEnvelopeDateTime {
        field: &'static str,
        expected: &'static str,
        digits: usize,
        value: String,
    },
    BundleFromOtherRelease {
        fv: String,
        built_by: Option<String>,
        expected: String,
        path: String,
    },
    Io(Error),
}
Expand description

Errors that can occur when using the Mapper API.

Variants§

§

DataDirNotFound

The specified data directory does not exist on disk.

Fields

§path: String
§

BundleNotFound

No data bundle file found for the requested format version.

Fields

§

VariantNotFound

The requested variant (e.g., “UTILMD_Strom”) is not present in the bundle.

Fields

§variant: String
§

PidNotFound

No mapping engine definitions exist for the given PID within the variant.

Fields

§variant: String
§

Assembly(AssemblyError)

An error from the MIG assembly layer.

§

Mapping(MappingError)

An error from the TOML mapping engine.

§

Serialization(String)

JSON serialization failed (e.g., when converting a typed struct to JSON).

§

NoMigSchema

The variant has no MIG schema (required for reverse pipeline).

Fields

§variant: String
§

MissingGroupEntrySegment(Box<GroupEntrySegmentError>)

The BO4E input fills a group’s segments but not the segment that opens the group in the MIG (e.g. Zaehler.geraeteNummer without Zaehler.zaehlertypMerkmal would yield SG10 CAV without CCI). Rendering it would produce EDIFACT no receiver can assemble, so the conversion is refused. Boxed to keep MapperError small.

§

MalformedEnvelopeDateTime

An EnvelopeOptions date or time is not the shape UNB takes.

The value is written into the interchange header verbatim, so a wrongly formatted one produces a malformed outermost envelope — the segment whose defects surface at the receiving gateway rather than anywhere the sender can see them. datum is yymmdd and zeit is hhmm, both digits only.

Fields

§field: &'static str

"datum" or "zeit".

§expected: &'static str

The expected pattern, e.g. "yymmdd".

§digits: usize

How many digits that pattern is.

§value: String

What the caller supplied.

§

BundleFromOtherRelease

The data bundle was produced by a different release than this crate.

The bundle’s serialisation format can be current while its mappings, schemas and code lists are from another era — that combination loads cleanly and renders a smaller message rather than failing (issue #158).

Fields

§fv: String

Format version of the bundle.

§built_by: Option<String>

The release that produced it, if it recorded one.

§expected: String

The release reading it.

§path: String

Where the bundle was read from.

§

Io(Error)

A standard I/O error.

Trait Implementations§

Source§

impl Debug for MapperError

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for MapperError

Source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Error for MapperError

Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0:

use the Display impl or to_string()

1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl From<AssemblyError> for MapperError

Source§

fn from(source: AssemblyError) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for MapperError

Source§

fn from(source: Error) -> Self

Converts to this type from the input type.
Source§

impl From<MappingError> for MapperError

Source§

fn from(source: MappingError) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more