pub struct JobId(pub String);Expand description
A unique identifier for a queued job.
Tuple Fields§
§0: StringImplementations§
Source§impl JobId
impl JobId
Sourcepub fn generate() -> Self
pub fn generate() -> Self
Generates an id that is unique within this process and across restarts.
The prefix is fixed once per process from the start instant and the pid, so two runs never overlap; the suffix is a monotonic counter, so two jobs in one run never collide. This replaces a random UUID: uniqueness is the only property callers need, and a counter gets it without a random source or a 36-byte string.
Trait Implementations§
impl Eq for JobId
impl StructuralPartialEq for JobId
Auto Trait Implementations§
impl Freeze for JobId
impl RefUnwindSafe for JobId
impl Send for JobId
impl Sync for JobId
impl Unpin for JobId
impl UnsafeUnpin for JobId
impl UnwindSafe for JobId
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