[−][src]Struct xaynet::state_machine::phases::PhaseState
The state corresponding to a phase of the PET protocol.
This contains the state-dependent inner
state and the state-independent coordinator_state
which is shared across state transitions.
Implementations
impl<R> PhaseState<R, StateError>
[src]
pub fn new(
coordinator_state: CoordinatorState,
request_rx: RequestReceiver<R>,
error: StateError
) -> Self
[src]
coordinator_state: CoordinatorState,
request_rx: RequestReceiver<R>,
error: StateError
) -> Self
Creates a new error state.
impl<R> PhaseState<R, Idle>
[src]
pub fn new(
coordinator_state: CoordinatorState,
request_rx: RequestReceiver<R>
) -> Self
[src]
coordinator_state: CoordinatorState,
request_rx: RequestReceiver<R>
) -> Self
Creates a new idle state.
impl<R> PhaseState<R, Shutdown>
[src]
pub fn new(
coordinator_state: CoordinatorState,
request_rx: RequestReceiver<R>
) -> Self
[src]
coordinator_state: CoordinatorState,
request_rx: RequestReceiver<R>
) -> Self
Creates a new shutdown state.
impl<R> PhaseState<R, Sum>
[src]
pub fn new(
coordinator_state: CoordinatorState,
request_rx: RequestReceiver<R>
) -> Self
[src]
coordinator_state: CoordinatorState,
request_rx: RequestReceiver<R>
) -> Self
Creates a new sum state.
impl<R> PhaseState<R, Sum2>
[src]
pub fn new(
coordinator_state: CoordinatorState,
request_rx: RequestReceiver<R>,
sum_dict: SumDict,
aggregation: Aggregation
) -> Self
[src]
coordinator_state: CoordinatorState,
request_rx: RequestReceiver<R>,
sum_dict: SumDict,
aggregation: Aggregation
) -> Self
Creates a new sum2 state.
impl<R> PhaseState<R, Unmask>
[src]
pub fn new(
coordinator_state: CoordinatorState,
request_rx: RequestReceiver<R>,
aggregation: Aggregation,
mask_dict: MaskDict
) -> Self
[src]
coordinator_state: CoordinatorState,
request_rx: RequestReceiver<R>,
aggregation: Aggregation,
mask_dict: MaskDict
) -> Self
Creates a new unmask state.
impl<R> PhaseState<R, Update>
[src]
pub fn new(
coordinator_state: CoordinatorState,
request_rx: RequestReceiver<R>,
frozen_sum_dict: SumDict,
seed_dict: SeedDict
) -> Self
[src]
coordinator_state: CoordinatorState,
request_rx: RequestReceiver<R>,
frozen_sum_dict: SumDict,
seed_dict: SeedDict
) -> Self
Creates a new update state.
impl<R, S> PhaseState<R, S> where
Self: Phase<R> + Purge<R>,
[src]
Self: Phase<R> + Purge<R>,
pub async fn run_phase(__arg0: Self) -> Option<StateMachine<R>>
[src]
Run the current phase to completion, then transition to the next phase and return it.
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]
impl<R> Handler<Request> for PhaseState<R, Idle>
[src]
fn handle_request(&mut self, req: Request)
[src]
Reject all the request with a [PetError::InvalidMessage
]
impl<R> Handler<Request> for PhaseState<R, Sum>
[src]
fn handle_request(&mut self, req: Request)
[src]
Handles a Request::Sum
, Request::Update
or Request::Sum2
request.
If the request is a Request::Update
or Request::Sum2
request, the request sender
will receive a PetError::InvalidMessage
.
impl<R> Handler<Request> for PhaseState<R, Sum2>
[src]
fn handle_request(&mut self, req: Request)
[src]
Handles a Request::Sum
, Request::Update
or Request::Sum2
request.
If the request is a Request::Sum
or Request::Update
request, the request sender
will receive a PetError::InvalidMessage
.
impl<R> Handler<Request> for PhaseState<R, Update>
[src]
fn handle_request(&mut self, req: Request)
[src]
Handles a Request::Sum
, Request::Update
or Request::Sum2
request.
If the request is a Request::Sum
or Request::Sum2
request, the request sender
will receive a PetError::InvalidMessage
.
impl<R, S> Handler<Traced<Request>> for PhaseState<R, S> where
Self: Handler<Request>,
[src]
Self: Handler<Request>,
fn handle_request(&mut self, req: Traced<Request>)
[src]
Handles a Request
.
impl<R> Phase<R> for PhaseState<R, StateError> where
R: Send,
[src]
R: Send,
const NAME: PhaseName
[src]
fn run<'life0, 'async_trait>(
&'life0 mut self
) -> Pin<Box<dyn Future<Output = Result<(), StateError>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
[src]
&'life0 mut self
) -> Pin<Box<dyn Future<Output = Result<(), StateError>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
fn next(self) -> Option<StateMachine<R>>
[src]
Moves from the error state to the next state.
See the module level documentation for more details.
impl<R> Phase<R> for PhaseState<R, Idle> where
R: Send,
[src]
R: Send,
const NAME: PhaseName
[src]
fn run<'life0, 'async_trait>(
&'life0 mut self
) -> Pin<Box<dyn Future<Output = Result<(), StateError>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
[src]
&'life0 mut self
) -> Pin<Box<dyn Future<Output = Result<(), StateError>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
Moves from the idle state to the next state.
See the module level documentation for more details.
fn next(self) -> Option<StateMachine<R>>
[src]
impl<R> Phase<R> for PhaseState<R, Shutdown> where
R: Send,
[src]
R: Send,
const NAME: PhaseName
[src]
fn run<'life0, 'async_trait>(
&'life0 mut self
) -> Pin<Box<dyn Future<Output = Result<(), StateError>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
[src]
&'life0 mut self
) -> Pin<Box<dyn Future<Output = Result<(), StateError>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
Shuts down the StateMachine
.
See the module level documentation for more details.
fn next(self) -> Option<StateMachine<R>>
[src]
impl<R> Phase<R> for PhaseState<R, Sum> where
Self: Handler<R> + Purge<R>,
R: Send,
[src]
Self: Handler<R> + Purge<R>,
R: Send,
const NAME: PhaseName
[src]
fn run<'life0, 'async_trait>(
&'life0 mut self
) -> Pin<Box<dyn Future<Output = Result<(), StateError>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
[src]
&'life0 mut self
) -> Pin<Box<dyn Future<Output = Result<(), StateError>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
Run the sum phase.
See the module level documentation for more details.
fn next(self) -> Option<StateMachine<R>>
[src]
impl<R> Phase<R> for PhaseState<R, Sum2> where
Self: Purge<R> + Handler<R>,
R: Send,
[src]
Self: Purge<R> + Handler<R>,
R: Send,
const NAME: PhaseName
[src]
fn run<'life0, 'async_trait>(
&'life0 mut self
) -> Pin<Box<dyn Future<Output = Result<(), StateError>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
[src]
&'life0 mut self
) -> Pin<Box<dyn Future<Output = Result<(), StateError>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
Run the sum2 phase
See the module level documentation for more details.
fn next(self) -> Option<StateMachine<R>>
[src]
Moves from the sum2 state to the next state.
See the module level documentation for more details.
impl<R> Phase<R> for PhaseState<R, Unmask> where
R: Send,
[src]
R: Send,
const NAME: PhaseName
[src]
fn run<'life0, 'async_trait>(
&'life0 mut self
) -> Pin<Box<dyn Future<Output = Result<(), StateError>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
[src]
&'life0 mut self
) -> Pin<Box<dyn Future<Output = Result<(), StateError>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
Run the unmasking phase
fn next(self) -> Option<StateMachine<R>>
[src]
Moves from the unmask state to the next state.
See the module level documentation for more details.
impl<R> Phase<R> for PhaseState<R, Update> where
Self: Handler<R> + Purge<R>,
R: Send,
[src]
Self: Handler<R> + Purge<R>,
R: Send,
const NAME: PhaseName
[src]
fn run<'life0, 'async_trait>(
&'life0 mut self
) -> Pin<Box<dyn Future<Output = Result<(), StateError>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
[src]
&'life0 mut self
) -> Pin<Box<dyn Future<Output = Result<(), StateError>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
Moves from the update state to the next state.
See the module level documentation for more details.
fn next(self) -> Option<StateMachine<R>>
[src]
impl<R, S> Purge<Request> for PhaseState<R, S>
[src]
fn handle_outdated_request(&mut self, req: Request)
[src]
impl<R, S> Purge<Traced<Request>> for PhaseState<R, S> where
Self: Purge<Request>,
[src]
Self: Purge<Request>,
fn handle_outdated_request(&mut self, req: Traced<Request>)
[src]
Auto Trait Implementations
impl<R, S> !RefUnwindSafe for PhaseState<R, S>
impl<R, S> Send for PhaseState<R, S> where
R: Send,
S: Send,
R: Send,
S: Send,
impl<R, S> Sync for PhaseState<R, S> where
R: Send,
S: Sync,
R: Send,
S: Sync,
impl<R, S> Unpin for PhaseState<R, S> where
S: Unpin,
S: Unpin,
impl<R, S> !UnwindSafe for PhaseState<R, S>
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>,