CandidateAction

Type Alias CandidateAction 

Source
pub type CandidateAction<ActionHandler, Args, State> = Action<Candidate<ActionHandler, Args, State>>;
Expand description

A convenience type for an action candidate

Aliased Type§

pub struct CandidateAction<ActionHandler, Args, State> { /* private fields */ }

Implementations§

Source§

impl<ActionHandler, Args, State> CandidateAction<ActionHandler, Args, State>
where ActionHandler: Handler<Args, State> + Clone + Send + 'static, Args: Clone + Send + 'static, State: Clone + Send + 'static,

Source

pub fn new(action: ActionHandler) -> Self

Create an Actionable [Candidate] from a given ActionHandler.

Source

pub fn with_state( self, state: State, ) -> Action<Ready<ActionHandler, Args, State>>

Create a new Actionable Ready from an action and a state.

Source§

impl<ActionHandler, Args> CandidateAction<ActionHandler, Args, ()>
where ActionHandler: Handler<Args, ()> + Clone + Send + 'static, Args: Clone + Send + 'static,

Source

pub fn stateless(self) -> Action<Stateless<ActionHandler, Args>>

Create a new Actionable Stateless from an action, with no state.

Trait Implementations§

Source§

impl<ActionHandler, Args, State> Actionable<State> for CandidateAction<ActionHandler, Args, State>
where ActionHandler: Handler<Args, State> + Clone + Send + Sync + 'static, Args: Clone + Send + Sync + 'static, State: Clone + Send + Sync + 'static,

Source§

fn into_actionable(self: Box<Self>, state: State) -> Action<Active>

Take a given boxed action and state and return an active actionable.
Source§

impl<IntoFrame, ActionHandler, Args> Service<IntoFrame> for CandidateAction<ActionHandler, Args, ()>
where IntoFrame: Into<Frame> + Clone + Send + 'static, ActionHandler: Handler<Args, ()> + Clone + Send + 'static, Args: Clone + Send + 'static,

Source§

type Response = Frame

Responses given by the service.
Source§

type Error = Error

Errors produced by the service.
Source§

type Future = FrameFuture

The future response value.
Source§

fn poll_ready(&mut self, cx: &mut Context<'_>) -> Poll<Result<(), Self::Error>>

Returns Poll::Ready(Ok(())) when the service is able to process requests. Read more
Source§

fn call(&mut self, frame: IntoFrame) -> Self::Future

Process the request and return the response asynchronously. Read more