pub struct StatelessWorker<T> { /* private fields */ }Expand description
Explicit unit-state adapter for a transform the caller asserts is stateless.
Construction is the opt-in assertion: mutable behavior that affects future outputs violates this adapter’s exact-resume contract. This makes opaque closure transforms usable without requiring downstream orphan impls.
Implementations§
Source§impl<T> StatelessWorker<T>
impl<T> StatelessWorker<T>
Sourcepub fn new(inner: T) -> Self
pub fn new(inner: T) -> Self
Explicitly asserts that a transform has no state affecting replay.
Sourcepub fn into_inner(self) -> T
pub fn into_inner(self) -> T
Returns the wrapped transform.
Trait Implementations§
Source§impl<T: Clone> Clone for StatelessWorker<T>
impl<T: Clone> Clone for StatelessWorker<T>
impl<T: Copy> Copy for StatelessWorker<T>
Source§impl<T: Debug> Debug for StatelessWorker<T>
impl<T: Debug> Debug for StatelessWorker<T>
Source§impl<T: Default> Default for StatelessWorker<T>
impl<T: Default> Default for StatelessWorker<T>
Source§impl<Input, T> Transform<Input> for StatelessWorker<T>where
T: Transform<Input>,
impl<Input, T> Transform<Input> for StatelessWorker<T>where
T: Transform<Input>,
Source§impl<T> WorkerCheckpoint for StatelessWorker<T>
impl<T> WorkerCheckpoint for StatelessWorker<T>
Source§fn validate_snapshot(&self, _state: &Self::State) -> Result<()>
fn validate_snapshot(&self, _state: &Self::State) -> Result<()>
Checks state compatibility without mutation.
Source§fn restore_validated(&mut self, _state: &Self::State)
fn restore_validated(&mut self, _state: &Self::State)
Restores state accepted by
Self::validate_snapshot.Auto Trait Implementations§
impl<T> Forget for StatelessWorker<T>
impl<T> Freeze for StatelessWorker<T>where
T: Freeze,
impl<T> RefUnwindSafe for StatelessWorker<T>where
T: RefUnwindSafe,
impl<T> Send for StatelessWorker<T>where
T: Send,
impl<T> Sync for StatelessWorker<T>where
T: Sync,
impl<T> Unpin for StatelessWorker<T>where
T: Unpin,
impl<T> UnsafeUnpin for StatelessWorker<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for StatelessWorker<T>where
T: UnwindSafe,
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