Struct hyperid::Id [−][src]
pub struct Id { /* fields omitted */ }
Expand description
Structure for keeping data
Implementations
Return a bytes representation of id
use hyperid::HyperId; let mut hyperid = HyperId::new(); let id = hyperid.get(); println!("{:?}", id.into_bytes());
Build Id instance from bytes
use hyperid::{HyperId, Id}; let bytes = vec![0; 17]; let id = Id::from_bytes(bytes).unwrap(); assert_eq!(vec![0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], id.into_bytes());
This is supported on crate feature url_safe
only.
This is supported on crate feature
url_safe
only.Return an url safe string
use hyperid::HyperId; let mut hyperid = HyperId::new(); let id = hyperid.get(); println!("{}", id.to_url_safe()); // 3ZAYYJilG7vHTqiUuaQdFg.0
This is supported on crate feature url_safe
only.
This is supported on crate feature
url_safe
only.Return an url safe string
use hyperid::{HyperId, Id}; let mut hyperid = HyperId::new(); let id1 = hyperid.get(); let s = id1.to_url_safe(); let id2 = Id::from_url_safe(s).unwrap(); assert_eq!(id1, id2);
Trait Implementations
Auto Trait Implementations
Blanket Implementations
Mutably borrows from an owned value. Read more