#[non_exhaustive]pub enum Zaehlergroesse {
Show 22 variants
G2Komma5,
G4,
G6,
G10,
G16,
G25,
G40,
G65,
G100,
G160,
G250,
G400,
G650,
G1000,
G1600,
G2500,
G4000,
G6500,
G10000,
G12500,
G16000,
Unknown,
}versioned and (crate features json or versioned) only.Expand description
Auflistung möglicher Größen von Zählern
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
G2Komma5
G4
G6
G10
G16
G25
G40
G65
G100
G160
G250
G400
G650
G1000
G1600
G2500
G4000
G6500
G10000
G12500
G16000
Unknown
Unknown or future variant — produced when deserializing a value that is not yet known to this version of the library.
Implementations§
Source§impl Zaehlergroesse
impl Zaehlergroesse
Sourcepub const VARIANTS: &'static [Self]
pub const VARIANTS: &'static [Self]
All variants defined by the BO4E schema, in declaration order.
Excludes the forward-compatibility Zaehlergroesse::Unknown catch-all, so this
is exactly the set of values that appear on the wire. Available without
the strum feature — use it to drift-guard SQL CHECK lists and mappings.
Sourcepub const COUNT: usize
pub const COUNT: usize
Number of schema-defined variants (equal to VARIANTS.len()), excluding the
Zaehlergroesse::Unknown catch-all. Stable for this schema version.
Sourcepub fn iter_known() -> impl Iterator<Item = Self> + Clone
pub fn iter_known() -> impl Iterator<Item = Self> + Clone
Returns an iterator over all known variants of Zaehlergroesse.
Yields only variants that correspond to values defined in the BO4E schema
(i.e. Self::VARIANTS), never the Zaehlergroesse::Unknown catch-all.
Available without the strum feature.
§Example
// Never yields the `Unknown` catch-all, so the count matches `COUNT`.
assert_eq!(Zaehlergroesse::iter_known().count(), Zaehlergroesse::COUNT);
assert!(Zaehlergroesse::iter_known().all(|v| v.is_known()));Sourcepub const fn as_wire(&self) -> &'static str
pub const fn as_wire(&self) -> &'static str
Returns the canonical BO4E wire string (SCREAMING_SNAKE_CASE) for this value.
Zaehlergroesse::Unknown renders as "UNKNOWN", matching its serialized form.
Sourcepub fn from_wire(s: &str) -> Result<Self, UnknownVariant>
pub fn from_wire(s: &str) -> Result<Self, UnknownVariant>
Strictly parses a BO4E wire string into a known variant.
Unlike the lenient serde / FromStr path — which maps
any unrecognized value (a typo, a legacy code, or a value from a newer schema)
to Zaehlergroesse::Unknown — this returns
Err for values not defined in this schema
version, including the literal "UNKNOWN". Use it at the ingest boundary to
reject bad values instead of silently degrading them.
§Example
assert_eq!(Zaehlergroesse::from_wire("G2KOMMA5"), Ok(Zaehlergroesse::G2Komma5));
// Out-of-schema values are rejected rather than degraded:
assert!(Zaehlergroesse::from_wire("NOT_A_REAL_VALUE").is_err());
// …including the `Unknown` catch-all's own wire spelling:
assert!(Zaehlergroesse::from_wire("UNKNOWN").is_err());Sourcepub const fn is_unknown(&self) -> bool
pub const fn is_unknown(&self) -> bool
Returns true if this value is the forward-compatibility
Zaehlergroesse::Unknown catch-all (an out-of-schema value).
Trait Implementations§
Source§impl AsRef<str> for Zaehlergroesse
impl AsRef<str> for Zaehlergroesse
Source§impl Bo4eEnum for Zaehlergroesse
impl Bo4eEnum for Zaehlergroesse
Source§const VARIANTS: &'static [Self] = Self::VARIANTS
const VARIANTS: &'static [Self] = Self::VARIANTS
Source§const COUNT: usize = Self::COUNT
const COUNT: usize = Self::COUNT
VARIANTS.len()), excluding
the Unknown catch-all. Stable for a given schema version — use it to
drift-guard hand-maintained variant counts.Source§fn as_wire(&self) -> &'static str
fn as_wire(&self) -> &'static str
Source§fn is_unknown(&self) -> bool
fn is_unknown(&self) -> bool
true if this value is the forward-compatibility Unknown
catch-all — i.e. an out-of-schema value produced by a lenient decode.Source§impl Bo4eStrict for Zaehlergroesse
impl Bo4eStrict for Zaehlergroesse
Source§fn collect_unknown_enums(&self, path: &str, out: &mut Vec<String>)
fn collect_unknown_enums(&self, path: &str, out: &mut Vec<String>)
out, the field_path-formatted
location of every enum field in self (recursively) that holds the
forward-compatibility Unknown catch-all. path is the JSON-path of
self relative to the root of the check ("" at the top level). Read moreSource§fn unknown_enum_paths(&self) -> Vec<String>
fn unknown_enum_paths(&self) -> Vec<String>
Unknown. Empty when the value is fully in-schema.Source§fn ensure_known_enums(&self) -> Result<(), StrictError>
fn ensure_known_enums(&self) -> Result<(), StrictError>
Err(StrictError) listing every
out-of-schema (Unknown) enum value in self, or Ok(()) if there are
none. Call this after a lenient serde decode to reject payloads that
carry typos, legacy codes, or values from a newer schema.Source§impl Clone for Zaehlergroesse
impl Clone for Zaehlergroesse
Source§fn clone(&self) -> Zaehlergroesse
fn clone(&self) -> Zaehlergroesse
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl ComposeSchema for Zaehlergroesse
Available on crate feature utoipa only.
impl ComposeSchema for Zaehlergroesse
utoipa only.impl Copy for Zaehlergroesse
Source§impl Debug for Zaehlergroesse
impl Debug for Zaehlergroesse
Source§impl<'r> Decode<'r, Postgres> for Zaehlergroesse
Available on crate feature sqlx only.Decodes leniently, matching the serde path: a value the schema does not
define becomes Zaehlergroesse::Unknown rather than a decode error, so a
database row written by a newer schema version still reads back.
impl<'r> Decode<'r, Postgres> for Zaehlergroesse
sqlx only.Decodes leniently, matching the serde path: a value the schema does not
define becomes Zaehlergroesse::Unknown rather than a decode error, so a
database row written by a newer schema version still reads back.
Use Zaehlergroesse::from_wire on a String column, or check
Zaehlergroesse::is_known, where out-of-schema values must be rejected.
Source§impl<'de> Deserialize<'de> for Zaehlergroesse
Available on crate feature serde only.
impl<'de> Deserialize<'de> for Zaehlergroesse
serde only.Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Display for Zaehlergroesse
impl Display for Zaehlergroesse
Source§impl<'q> Encode<'q, Postgres> for Zaehlergroesse
Available on crate feature sqlx only.Encodes as the canonical BO4E wire string, borrowed from as_wire — no
intermediate String or serde_json::Value is allocated.
impl<'q> Encode<'q, Postgres> for Zaehlergroesse
sqlx only.Encodes as the canonical BO4E wire string, borrowed from as_wire — no
intermediate String or serde_json::Value is allocated.
Source§fn encode_by_ref(
&self,
buf: &mut <Postgres as Database>::ArgumentBuffer<'q>,
) -> Result<IsNull, BoxDynError>
fn encode_by_ref( &self, buf: &mut <Postgres as Database>::ArgumentBuffer<'q>, ) -> Result<IsNull, BoxDynError>
Source§fn encode(
self,
buf: &mut <DB as Database>::ArgumentBuffer<'q>,
) -> Result<IsNull, Box<dyn Error + Send + Sync>>where
Self: Sized,
fn encode(
self,
buf: &mut <DB as Database>::ArgumentBuffer<'q>,
) -> Result<IsNull, Box<dyn Error + Send + Sync>>where
Self: Sized,
self into buf in the expected format for the database.fn produces(&self) -> Option<<DB as Database>::TypeInfo>
fn size_hint(&self) -> usize
impl Eq for Zaehlergroesse
Source§impl<'_derivative_strum> From<&'_derivative_strum Zaehlergroesse> for &'static str
impl<'_derivative_strum> From<&'_derivative_strum Zaehlergroesse> for &'static str
Source§fn from(x: &'_derivative_strum Zaehlergroesse) -> &'static str
fn from(x: &'_derivative_strum Zaehlergroesse) -> &'static str
Source§impl From<Zaehlergroesse> for &'static str
impl From<Zaehlergroesse> for &'static str
Source§fn from(x: Zaehlergroesse) -> &'static str
fn from(x: Zaehlergroesse) -> &'static str
Source§impl FromStr for Zaehlergroesse
Available on crate feature strum only.
impl FromStr for Zaehlergroesse
strum only.Source§impl Hash for Zaehlergroesse
impl Hash for Zaehlergroesse
Source§impl IntoEnumIterator for Zaehlergroesse
Available on crate feature strum only.
impl IntoEnumIterator for Zaehlergroesse
strum only.type Iterator = ZaehlergroesseIter
fn iter() -> ZaehlergroesseIter ⓘ
Source§impl JsonSchema for Zaehlergroesse
Available on crate feature schemars only.
impl JsonSchema for Zaehlergroesse
schemars only.Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read moreSource§impl Ord for Zaehlergroesse
impl Ord for Zaehlergroesse
Source§fn cmp(&self, other: &Zaehlergroesse) -> Ordering
fn cmp(&self, other: &Zaehlergroesse) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for Zaehlergroesse
impl PartialEq for Zaehlergroesse
Source§impl PartialOrd for Zaehlergroesse
impl PartialOrd for Zaehlergroesse
Source§impl PgHasArrayType for Zaehlergroesse
Available on crate feature sqlx only.Lets Vec<Zaehlergroesse> bind to a TEXT[] column. Only this crate can
provide it: the trait and the enum are both foreign to any consumer, so the
orphan rule rules out a downstream impl.
impl PgHasArrayType for Zaehlergroesse
sqlx only.Lets Vec<Zaehlergroesse> bind to a TEXT[] column. Only this crate can
provide it: the trait and the enum are both foreign to any consumer, so the
orphan rule rules out a downstream impl.
fn array_type_info() -> PgTypeInfo
fn array_compatible(ty: &PgTypeInfo) -> bool
Source§impl Serialize for Zaehlergroesse
Available on crate feature serde only.
impl Serialize for Zaehlergroesse
serde only.impl StructuralPartialEq for Zaehlergroesse
Source§impl ToSchema for Zaehlergroesse
Available on crate feature utoipa only.
impl ToSchema for Zaehlergroesse
utoipa only.Source§impl TryFrom<&str> for Zaehlergroesse
Available on crate feature strum only.
impl TryFrom<&str> for Zaehlergroesse
strum only.Source§impl Type<Postgres> for Zaehlergroesse
Available on crate feature sqlx only.
impl Type<Postgres> for Zaehlergroesse
sqlx only.Auto Trait Implementations§
impl Freeze for Zaehlergroesse
impl RefUnwindSafe for Zaehlergroesse
impl Send for Zaehlergroesse
impl Sync for Zaehlergroesse
impl Unpin for Zaehlergroesse
impl UnsafeUnpin for Zaehlergroesse
impl UnwindSafe for Zaehlergroesse
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T, O> Matches<O> for Twhere
T: PartialEq<O>,
impl<T, O> Matches<O> for Twhere
T: PartialEq<O>,
fn validate_matches(&self, other: &O) -> bool
Source§impl<T> PartialSchema for Twhere
T: ComposeSchema + ?Sized,
impl<T> PartialSchema for Twhere
T: ComposeSchema + ?Sized,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
Source§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
ToCompactString::to_compact_string() Read moreSource§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
CompactString. Read more