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>;
}
Associated Types
Required methods
unsafe fn get_state_unchecked(&self) -> Self::State
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>
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.