AddressFormat

Trait AddressFormat 

Source
pub trait AddressFormat: Sized {
    // Required methods
    fn parse(s: &str) -> Result<Self, AddressError>;
    fn validate(s: &str) -> Result<(), AddressError>;
    fn to_string(&self) -> String;
}
Expand description

Common trait for all address types.

Required Methods§

Source

fn parse(s: &str) -> Result<Self, AddressError>

Parse from string.

Source

fn validate(s: &str) -> Result<(), AddressError>

Validate string format.

Source

fn to_string(&self) -> String

Convert to canonical string representation.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§