pub struct CurrencyCode(/* private fields */);Expand description
A structurally valid ISO 4217 alphabetic currency code.
This type intentionally validates the stable three-uppercase-ASCII-letter structure, not mutable current-currency membership. Provider configuration validates membership against a versioned ISO 4217 catalog; durable events must remain readable after a code becomes historical.
Implementations§
Source§impl CurrencyCode
impl CurrencyCode
Sourcepub fn new(bytes: [u8; 3]) -> Result<Self, CurrencyCodeError>
pub fn new(bytes: [u8; 3]) -> Result<Self, CurrencyCodeError>
Validates an alphabetic currency code.
§Errors
Returns CurrencyCodeError::InvalidCharacter when any byte is not an
uppercase ASCII letter.
Trait Implementations§
Source§impl Clone for CurrencyCode
impl Clone for CurrencyCode
impl Copy for CurrencyCode
Source§impl Debug for CurrencyCode
impl Debug for CurrencyCode
Source§impl<'de> Deserialize<'de> for CurrencyCode
impl<'de> Deserialize<'de> for CurrencyCode
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>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for CurrencyCode
impl Display for CurrencyCode
impl Eq for CurrencyCode
Source§impl FromStr for CurrencyCode
impl FromStr for CurrencyCode
Source§impl Hash for CurrencyCode
impl Hash for CurrencyCode
Source§impl JsonSchema for CurrencyCode
impl JsonSchema for CurrencyCode
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(_: &mut SchemaGenerator) -> Schema
fn json_schema(_: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn inline_schema() -> bool
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 moreSource§impl Ord for CurrencyCode
impl Ord for CurrencyCode
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialEq for CurrencyCode
impl PartialEq for CurrencyCode
Source§impl PartialOrd for CurrencyCode
impl PartialOrd for CurrencyCode
Source§impl Serialize for CurrencyCode
impl Serialize for CurrencyCode
impl StructuralPartialEq for CurrencyCode
Auto Trait Implementations§
impl Forget for CurrencyCode
impl Freeze for CurrencyCode
impl Move for CurrencyCode
impl RefUnwindSafe for CurrencyCode
impl Send for CurrencyCode
impl Sync for CurrencyCode
impl Unpin for CurrencyCode
impl UnsafeUnpin for CurrencyCode
impl UnwindSafe for CurrencyCode
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
Mutably borrows from an owned value. Read more