pub struct EvseId { /* private fields */ }Expand description
An e-mobility identifier: type character + body + check character.
Implementations§
Source§impl EvseId
impl EvseId
Sourcepub fn generate(kind: IdType, body: &str) -> Result<EvseId, Error>
pub fn generate(kind: IdType, body: &str) -> Result<EvseId, Error>
Builds an identifier from a type and a body, appending the check character. The body is uppercased.
Sourcepub fn station(seq: u64) -> EvseId
pub fn station(seq: u64) -> EvseId
Station identifier for a numeric sequence, e.g. station(1) → S000001 + check.
Sourcepub fn evse_of(station: &EvseId, evse_number: u32) -> Result<EvseId, Error>
pub fn evse_of(station: &EvseId, evse_number: u32) -> Result<EvseId, Error>
EVSE identifier derived from its station identifier and EVSE number,
e.g. station S000001X, evse 2 → E00000102 + check.
Sourcepub fn parse(s: &str) -> Result<EvseId, Error>
pub fn parse(s: &str) -> Result<EvseId, Error>
Parses and verifies an identifier (<Type><body><check>, case-insensitive).
pub fn kind(&self) -> IdType
pub fn check_char(&self) -> char
pub fn as_str(&self) -> &str
Sourcepub fn with_operator(&self, country: &str, operator: &str) -> String
pub fn with_operator(&self, country: &str, operator: &str) -> String
Full eMI³ form with country and operator prefix, e.g. FR*ABC*E00000102K.
The check character only covers the local part.
Trait Implementations§
impl Eq for EvseId
Source§impl Ord for EvseId
impl Ord for EvseId
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 PartialOrd for EvseId
impl PartialOrd for EvseId
impl StructuralPartialEq for EvseId
Auto Trait Implementations§
impl Freeze for EvseId
impl RefUnwindSafe for EvseId
impl Send for EvseId
impl Sync for EvseId
impl Unpin for EvseId
impl UnsafeUnpin for EvseId
impl UnwindSafe for EvseId
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