pub struct Token<T> { /* private fields */ }Expand description
An immutable token carrying a typed value through the Petri net.
Tokens flow from place to place as transitions fire, carrying typed payloads that represent the state of a computation or workflow.
Implementations§
Source§impl<T> Token<T>
impl<T> Token<T>
Sourcepub fn at(value: T, created_at: u64) -> Self
pub fn at(value: T, created_at: u64) -> Self
Creates a token with a specific timestamp (for testing/replay).
Sourcepub fn from_arc(value: Arc<T>, created_at: u64) -> Self
pub fn from_arc(value: Arc<T>, created_at: u64) -> Self
Creates a token wrapping an existing Arc value.
Sourcepub fn created_at(&self) -> u64
pub fn created_at(&self) -> u64
Returns the creation timestamp in epoch milliseconds.
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for Token<T>
impl<T> RefUnwindSafe for Token<T>where
T: RefUnwindSafe,
impl<T> Send for Token<T>
impl<T> Sync for Token<T>
impl<T> Unpin for Token<T>
impl<T> UnsafeUnpin for Token<T>
impl<T> UnwindSafe for Token<T>where
T: RefUnwindSafe,
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