pub trait UlidGenerator<ID, T, R>{
type Err: Debug;
// Required methods
fn new(time: T, rng: R) -> Self;
fn next_id(&self) -> IdGenStatus<ID>;
fn try_next_id(&self) -> Result<IdGenStatus<ID>, Self::Err>;
}Available on crate feature
ulid only.Expand description
A minimal interface for generating Ulid IDs
Required Associated Types§
Required Methods§
fn new(time: T, rng: R) -> Self
Sourcefn next_id(&self) -> IdGenStatus<ID>
fn next_id(&self) -> IdGenStatus<ID>
Returns the next available ID
Sourcefn try_next_id(&self) -> Result<IdGenStatus<ID>, Self::Err>
fn try_next_id(&self) -> Result<IdGenStatus<ID>, Self::Err>
A fallible version of Self::next_id that returns a Result.
§Errors
- May return an error if the underlying generator uses a lock and it is poisoned.
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§
Source§impl<ID, T, R> UlidGenerator<ID, T, R> for AtomicMonoUlidGenerator<ID, T, R>
Available on crate feature atomic and target_has_atomic=128 and (crate features snowflake or ulid) only.
impl<ID, T, R> UlidGenerator<ID, T, R> for AtomicMonoUlidGenerator<ID, T, R>
Available on crate feature
atomic and target_has_atomic=128 and (crate features snowflake or ulid) only.type Err = Infallible
Source§impl<ID, T, R> UlidGenerator<ID, T, R> for BasicMonoUlidGenerator<ID, T, R>
Available on crate feature basic and (crate features snowflake or ulid) only.
impl<ID, T, R> UlidGenerator<ID, T, R> for BasicMonoUlidGenerator<ID, T, R>
Available on crate feature
basic and (crate features snowflake or ulid) only.type Err = Infallible
Source§impl<ID, T, R> UlidGenerator<ID, T, R> for BasicUlidGenerator<ID, T, R>
Available on crate feature basic and (crate features snowflake or ulid) only.
impl<ID, T, R> UlidGenerator<ID, T, R> for BasicUlidGenerator<ID, T, R>
Available on crate feature
basic and (crate features snowflake or ulid) only.type Err = Infallible
Source§impl<ID, T, R> UlidGenerator<ID, T, R> for LockMonoUlidGenerator<ID, T, R>
Available on crate feature lock and (crate features snowflake or ulid) only.
impl<ID, T, R> UlidGenerator<ID, T, R> for LockMonoUlidGenerator<ID, T, R>
Available on crate feature
lock and (crate features snowflake or ulid) only.