Trait streamcatcher::StateAccess[][src]

pub trait StateAccess {
    type State;
    unsafe fn get_state_unchecked(&self) -> Self::State;
fn get_final_state(&self) -> Option<Self::State>; }
Expand description

External access to (Async)Transform state via a TxCatcher (resp. async variants).

Associated Types

Transform state.

Required methods

Directly access a transform’s state before a stream has finished.

Safety

This accesses the underlying transform without first acquiring a lock, possibly causing shared access to the transform struct. Retrieved state could be generated based on an inconsistent or semi-committed mutable access to (Async)Transform.

To use safely, implementers of Stateful must ensure that appropriate concurrency controls are used (e.g., atomics or locks) when producing state data.

Returns the transform’s state if the source (and transform) are finished.

As no future write accesses to the transform object can occur once the stream finishes, accesses are guaranteed to be safe.

Implementors