pub struct Generator {}
Expand description
§Generator
top level structure for interfacing with the library
use minimal_id::Generator;
let id = Generator::new_id();
Implementations§
Source§impl Generator
impl Generator
Sourcepub fn generate(&self) -> MinimalId
👎Deprecated since 0.8.0: Use Generator::new_id or MinimalId::generate
pub fn generate(&self) -> MinimalId
Returns a new Minimal Id
Sourcepub fn id_from_str(&self, id_str: &str) -> Result<MinimalId, ()>
pub fn id_from_str(&self, id_str: &str) -> Result<MinimalId, ()>
Parse a string into a minimal ID
let id = generator
.id_from_str("AAECAwQFBgcI")
.expect("Cannot parse String into ID");
assert_eq!(id.to_slice()[0], 0);
pub fn new_id() -> MinimalId
Trait Implementations§
impl StructuralPartialEq for Generator
Auto Trait Implementations§
impl Freeze for Generator
impl RefUnwindSafe for Generator
impl Send for Generator
impl Sync for Generator
impl Unpin for Generator
impl UnwindSafe for Generator
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