Skip to main content

Zaehlergroesse

Enum Zaehlergroesse 

Source
#[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,
}
Available on crate feature 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
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

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

Source

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.

Source

pub const COUNT: usize

Number of schema-defined variants (equal to VARIANTS.len()), excluding the Zaehlergroesse::Unknown catch-all. Stable for this schema version.

Source

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()));
Source

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.

Source

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());
Source

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).

Source

pub const fn is_known(&self) -> bool

Returns true if this value is a known, schema-defined variant.

Trait Implementations§

Source§

impl AsRef<str> for Zaehlergroesse

Source§

fn as_ref(&self) -> &str

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl Bo4eEnum for Zaehlergroesse

Source§

const VARIANTS: &'static [Self] = Self::VARIANTS

All variants defined by the BO4E schema, in declaration order. Read more
Source§

const COUNT: usize = Self::COUNT

Number of schema-defined variants (equal to 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

Returns the canonical BO4E wire string (SCREAMING_SNAKE_CASE) for this value.
Source§

fn from_wire(s: &str) -> Result<Self, UnknownVariant>

Strictly parses a BO4E wire string, returning Err for any value not defined in this schema version — including the literal "UNKNOWN". Read more
Source§

fn is_unknown(&self) -> bool

Returns true if this value is the forward-compatibility Unknown catch-all — i.e. an out-of-schema value produced by a lenient decode.
Source§

fn is_known(&self) -> bool

Returns true if this value is a known, schema-defined variant.
Source§

impl Bo4eStrict for Zaehlergroesse

Source§

fn collect_unknown_enums(&self, path: &str, out: &mut Vec<String>)

Appends, to 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 more
Source§

fn unknown_enum_paths(&self) -> Vec<String>

Returns the JSON-paths of every enum field (recursively) that decoded to Unknown. Empty when the value is fully in-schema.
Source§

fn ensure_known_enums(&self) -> Result<(), StrictError>

Returns 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

Source§

fn clone(&self) -> Zaehlergroesse

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl ComposeSchema for Zaehlergroesse

Available on crate feature utoipa only.
Source§

impl Copy for Zaehlergroesse

Source§

impl Debug for Zaehlergroesse

Source§

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

Formats the value using the given formatter. Read more
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.

Use Zaehlergroesse::from_wire on a String column, or check Zaehlergroesse::is_known, where out-of-schema values must be rejected.

Source§

fn decode( value: <Postgres as Database>::ValueRef<'r>, ) -> Result<Self, BoxDynError>

Decode a new value of this type using a raw value from the database.
Source§

impl<'de> Deserialize<'de> for Zaehlergroesse

Available on crate feature serde only.
Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Display for Zaehlergroesse

Source§

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

Formats the value using the given formatter. Read more
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.

Source§

fn encode_by_ref( &self, buf: &mut <Postgres as Database>::ArgumentBuffer<'q>, ) -> Result<IsNull, BoxDynError>

Writes the value of self into buf without moving self. Read more
Source§

fn encode( self, buf: &mut <DB as Database>::ArgumentBuffer<'q>, ) -> Result<IsNull, Box<dyn Error + Send + Sync>>
where Self: Sized,

Writes the value of self into buf in the expected format for the database.
Source§

fn produces(&self) -> Option<<DB as Database>::TypeInfo>

Source§

fn size_hint(&self) -> usize

Source§

impl Eq for Zaehlergroesse

Source§

impl<'_derivative_strum> From<&'_derivative_strum Zaehlergroesse> for &'static str

Source§

fn from(x: &'_derivative_strum Zaehlergroesse) -> &'static str

Converts to this type from the input type.
Source§

impl From<Zaehlergroesse> for &'static str

Source§

fn from(x: Zaehlergroesse) -> &'static str

Converts to this type from the input type.
Source§

impl FromStr for Zaehlergroesse

Available on crate feature strum only.
Source§

type Err = ParseError

The associated error which can be returned from parsing.
Source§

fn from_str(s: &str) -> Result<Zaehlergroesse, <Self as FromStr>::Err>

Parses a string s to return a value of this type. Read more
Source§

impl Hash for Zaehlergroesse

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl IntoEnumIterator for Zaehlergroesse

Available on crate feature strum only.
Source§

impl JsonSchema for Zaehlergroesse

Available on crate feature schemars only.
Source§

fn schema_name() -> Cow<'static, str>

The name of the generated JSON Schema. Read more
Source§

fn schema_id() -> Cow<'static, str>

Returns a string that uniquely identifies the schema produced by this type. Read more
Source§

fn json_schema(generator: &mut SchemaGenerator) -> Schema

Generates a JSON Schema for this type. Read more
Source§

fn inline_schema() -> bool

Whether JSON Schemas generated for this type should be included directly in parent schemas, rather than being re-used where possible using the $ref keyword. Read more
Source§

impl Ord for Zaehlergroesse

Source§

fn cmp(&self, other: &Zaehlergroesse) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 (const: unstable) · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 (const: unstable) · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

fn clamp_to<R>(self, range: R) -> Self
where Self: Sized, R: ClampBounds<Self>,

🔬This is a nightly-only experimental API. (clamp_to)
Restrict a value to a certain range. Read more
Source§

impl PartialEq for Zaehlergroesse

Source§

fn eq(&self, other: &Zaehlergroesse) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl PartialOrd for Zaehlergroesse

Source§

fn partial_cmp(&self, other: &Zaehlergroesse) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 (const: unstable) · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 (const: unstable) · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 (const: unstable) · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 (const: unstable) · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
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.

Source§

impl Serialize for Zaehlergroesse

Available on crate feature serde only.
Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for Zaehlergroesse

Source§

impl ToSchema for Zaehlergroesse

Available on crate feature utoipa only.
Source§

fn name() -> Cow<'static, str>

Return name of the schema. Read more
Source§

fn schemas(schemas: &mut Vec<(String, RefOr<Schema>)>)

Implement reference utoipa::openapi::schema::Schemas for this type. Read more
Source§

impl TryFrom<&str> for Zaehlergroesse

Available on crate feature strum only.
Source§

type Error = ParseError

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

fn try_from(s: &str) -> Result<Zaehlergroesse, <Self as TryFrom<&str>>::Error>

Performs the conversion.
Source§

impl Type<Postgres> for Zaehlergroesse

Available on crate feature sqlx only.
Source§

fn type_info() -> PgTypeInfo

Returns the canonical SQL type for this Rust type. Read more
Source§

fn compatible(ty: &<DB as Database>::TypeInfo) -> bool

Determines if this Rust type is compatible with the given SQL type. Read more

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Comparable<K> for Q
where Q: Ord + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn compare(&self, key: &K) -> Ordering

Compare self to key and return their ordering.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts 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 more
Source§

impl<T, O> Matches<O> for T
where T: PartialEq<O>,

Source§

fn validate_matches(&self, other: &O) -> bool

Source§

impl<T> PartialSchema for T
where T: ComposeSchema + ?Sized,

Source§

fn schema() -> RefOr<Schema>

Return ref or schema of implementing type that can then be used to construct combined schemas.
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToCompactString for T
where T: Display,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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, <T as TryFrom<U>>::Error>

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<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

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