[−][src]Enum xaynet::state_machine::StateMachine
The state machine with all its states.
Variants
Idle(PhaseState<R, Idle>)
Sum(PhaseState<R, Sum>)
Update(PhaseState<R, Update>)
Sum2(PhaseState<R, Sum2>)
Unmask(PhaseState<R, Unmask>)
Error(PhaseState<R, StateError>)
Shutdown(PhaseState<R, Shutdown>)
Implementations
impl<R> StateMachine<R> where
PhaseState<R, Idle>: Phase<R> + Purge<R>,
PhaseState<R, Sum>: Phase<R> + Purge<R>,
PhaseState<R, Update>: Phase<R> + Purge<R>,
PhaseState<R, Sum2>: Phase<R> + Purge<R>,
PhaseState<R, Unmask>: Phase<R> + Purge<R>,
PhaseState<R, StateError>: Phase<R> + Purge<R>,
PhaseState<R, Shutdown>: Phase<R> + Purge<R>,
[src]
PhaseState<R, Idle>: Phase<R> + Purge<R>,
PhaseState<R, Sum>: Phase<R> + Purge<R>,
PhaseState<R, Update>: Phase<R> + Purge<R>,
PhaseState<R, Sum2>: Phase<R> + Purge<R>,
PhaseState<R, Unmask>: Phase<R> + Purge<R>,
PhaseState<R, StateError>: Phase<R> + Purge<R>,
PhaseState<R, Shutdown>: Phase<R> + Purge<R>,
pub fn new(
pet_settings: PetSettings,
mask_settings: MaskSettings,
model_settings: ModelSettings
) -> Result<(Self, RequestSender<R>, EventSubscriber), InitError>
[src]
pet_settings: PetSettings,
mask_settings: MaskSettings,
model_settings: ModelSettings
) -> Result<(Self, RequestSender<R>, EventSubscriber), InitError>
Creates a new state machine with the initial state Idle
.
Errors
Fails if there is insufficient system entropy to generate secrets.
ⓘNote
Note: If theStateMachine
is created viaPhaseState::
it must be ensured that the module::new(...) sodiumoxide::init()
has been initialized beforehand.
For example:
ⓘThis example deliberately fails to compile
sodiumoxide::init().unwrap(); let state_machine = StateMachine::from(PhaseState::<R, Idle>::new(coordinator_state, req_receiver));
pub async fn next(self) -> Option<Self>
[src]
Moves the StateMachine
to the next state and consumes the current one.
Returns the next state or None
if the StateMachine
reached the state Shutdown
.
pub async fn run(__arg0: Self) -> Option<()>
[src]
Runs the state machine until it shuts down.
The StateMachine
shuts down once all RequestSender
have been dropped.
Trait Implementations
impl<R> From<PhaseState<R, Idle>> for StateMachine<R>
[src]
fn from(original: PhaseState<R, Idle>) -> StateMachine<R>
[src]
impl<R> From<PhaseState<R, Shutdown>> for StateMachine<R>
[src]
fn from(original: PhaseState<R, Shutdown>) -> StateMachine<R>
[src]
impl<R> From<PhaseState<R, StateError>> for StateMachine<R>
[src]
fn from(original: PhaseState<R, StateError>) -> StateMachine<R>
[src]
impl<R> From<PhaseState<R, Sum>> for StateMachine<R>
[src]
fn from(original: PhaseState<R, Sum>) -> StateMachine<R>
[src]
impl<R> From<PhaseState<R, Sum2>> for StateMachine<R>
[src]
fn from(original: PhaseState<R, Sum2>) -> StateMachine<R>
[src]
impl<R> From<PhaseState<R, Unmask>> for StateMachine<R>
[src]
fn from(original: PhaseState<R, Unmask>) -> StateMachine<R>
[src]
impl<R> From<PhaseState<R, Update>> for StateMachine<R>
[src]
fn from(original: PhaseState<R, Update>) -> StateMachine<R>
[src]
Auto Trait Implementations
impl<R> !RefUnwindSafe for StateMachine<R>
impl<R> Send for StateMachine<R> where
R: Send,
R: Send,
impl<R> Sync for StateMachine<R> where
R: Send,
R: Send,
impl<R> Unpin for StateMachine<R>
impl<R> !UnwindSafe for StateMachine<R>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
fn instrument(self, span: Span) -> Instrumented<Self>
[src]
fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,
fn vzip(self) -> V
impl<T> WithSubscriber for T
[src]
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
[src]
S: Into<Dispatch>,