[][src]Trait streamcatcher::StateAccess

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

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

Associated Types

type State

Transform state.

Loading content...

Required methods

unsafe fn get_state_unchecked(&self) -> Self::State

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.

fn get_final_state(&self) -> Option<Self::State>

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.

Loading content...

Implementors

impl<T, Tx> StateAccess for TxCatcher<T, Tx> where
    Tx: Stateful
[src]

type State = <Tx as Stateful>::State

Loading content...