pub trait MapKey: CodeEnum + Ord {
const FIELD: &'static str;
const ALSO_FIELD: Option<&'static str>;
const CODES: &'static [(&'static str, &'static str, Option<&'static str>)];
// Provided methods
fn of_element(element: &Value) -> Result<Self, String> { ... }
fn fill_element(&self, element: &mut Value) { ... }
}Expand description
Qualifier key of a map-keyed entity collection.
Each variant is a raw EDIFACT qualifier code. CodeEnum::as_str is the
code itself (the map key); the element carries it in Self::FIELD (and
Self::ALSO_FIELD) as the engine writes it.
Required Associated Constants§
Sourceconst FIELD: &'static str
const FIELD: &'static str
Field of an element that carries the qualifier (e.g. "partnerrolle").
Sourceconst ALSO_FIELD: Option<&'static str>
const ALSO_FIELD: Option<&'static str>
Second field of a dual decomposition (e.g. "datenqualitaet").
Provided Methods§
Sourcefn of_element(element: &Value) -> Result<Self, String>
fn of_element(element: &Value) -> Result<Self, String>
Resolve the key of an engine JSON element the way the reverse mapping resolves the qualifier: joint match of both fields, else the first code written as the field’s value, else the field’s value as a raw code.
Sourcefn fill_element(&self, element: &mut Value)
fn fill_element(&self, element: &mut Value)
Write the key’s qualifier fields into element where they are absent.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".