pub struct Cep { /* private fields */ }Expand description
A validated CEP stored as 8 ASCII bytes.
use stdbr_core::cep::{Cep, generate_cep};
let cep = generate_cep();
assert_eq!(cep.as_str().len(), 8);
assert_eq!(cep.to_string().len(), 9); // #####-###
let parsed: Cep = cep.to_string().parse().unwrap();
assert_eq!(cep, parsed);Implementations§
Source§impl Cep
impl Cep
Sourcepub fn postal_region(&self) -> PostalRegion
pub fn postal_region(&self) -> PostalRegion
Postal region derived from the 1st digit.
Trait Implementations§
impl Copy for Cep
impl Eq for Cep
impl StructuralPartialEq for Cep
Auto Trait Implementations§
impl Freeze for Cep
impl RefUnwindSafe for Cep
impl Send for Cep
impl Sync for Cep
impl Unpin for Cep
impl UnsafeUnpin for Cep
impl UnwindSafe for Cep
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