[][src]Struct xaynet::state_machine::phases::PhaseState

pub struct PhaseState<R, S> { /* fields omitted */ }

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]

Creates a new error state.

impl<R> PhaseState<R, Idle>[src]

pub fn new(
    coordinator_state: CoordinatorState,
    request_rx: RequestReceiver<R>
) -> Self
[src]

Creates a new idle state.

impl<R> PhaseState<R, Shutdown>[src]

pub fn new(
    coordinator_state: CoordinatorState,
    request_rx: RequestReceiver<R>
) -> Self
[src]

Creates a new shutdown state.

impl<R> PhaseState<R, Sum>[src]

pub fn new(
    coordinator_state: CoordinatorState,
    request_rx: RequestReceiver<R>
) -> Self
[src]

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]

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]

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]

Creates a new update state.

impl<R, S> PhaseState<R, S> where
    Self: Phase<R> + Purge<R>, 
[src]

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]

impl<R> From<PhaseState<R, Shutdown>> for StateMachine<R>[src]

impl<R> From<PhaseState<R, StateError>> for StateMachine<R>[src]

impl<R> From<PhaseState<R, Sum>> for StateMachine<R>[src]

impl<R> From<PhaseState<R, Sum2>> for StateMachine<R>[src]

impl<R> From<PhaseState<R, Unmask>> for StateMachine<R>[src]

impl<R> From<PhaseState<R, Update>> for 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]

fn handle_request(&mut self, req: Traced<Request>)[src]

Handles a Request.

impl<R> Phase<R> for PhaseState<R, StateError> where
    R: Send
[src]

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]

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]

Moves from the idle state to the next state.

See the module level documentation for more details.

impl<R> Phase<R> for PhaseState<R, Shutdown> where
    R: Send
[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]

Shuts down the StateMachine.

See the module level documentation for more details.

impl<R> Phase<R> for PhaseState<R, Sum> where
    Self: Handler<R> + Purge<R>,
    R: Send
[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]

Run the sum phase.

See the module level documentation for more details.

impl<R> Phase<R> for PhaseState<R, Sum2> where
    Self: Purge<R> + Handler<R>,
    R: Send
[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]

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]

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]

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]

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]

Moves from the update state to the next state.

See the module level documentation for more details.

impl<R, S> Purge<Request> for PhaseState<R, S>[src]

impl<R, S> Purge<Traced<Request>> for PhaseState<R, S> where
    Self: Purge<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

impl<R, S> Sync for PhaseState<R, S> where
    R: Send,
    S: Sync

impl<R, S> Unpin for PhaseState<R, S> where
    S: Unpin

impl<R, S> !UnwindSafe for PhaseState<R, S>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

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]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 

impl<T> WithSubscriber for T[src]