StatelessSystem

Type Alias StatelessSystem 

Source
pub type StatelessSystem = System<Stateless, ()>;
Expand description

A system which has been finalized without state. We can handle frames with this system.

Aliased Type§

pub enum StatelessSystem {
    Batch(Batch<Stateless, ()>),
    DispatchBatch(DispatchBatch<Stateless, ()>),
    Routed(Routed<Stateless, ()>),
    FirstMatch(FirstMatch<Stateless, ()>),
}

Variants§

§

Batch(Batch<Stateless, ()>)

An unordered system that invokes all actions.

§

DispatchBatch(DispatchBatch<Stateless, ()>)

A system that routes frames to actions fully matching patterns.

§

Routed(Routed<Stateless, ()>)

A system that routes frames to matching patterns.

§

FirstMatch(FirstMatch<Stateless, ()>)

A system that invokes the first action that matches a frame.

Implementations§

Source§

impl StatelessSystem

Source

pub fn handle_frame(self, frame: Frame) -> FrameFuture

Call the system with a frame.

Trait Implementations§

Source§

impl Handler<Frame, ()> for StatelessSystem

Source§

type Future = FrameFuture

Action futures must resolve into an Frame of some kind.
Source§

fn invoke(&self, frame: impl Into<Frame>, _: ()) -> Self::Future

Invoke the action with a given frame and state, returning the frameual frame that will be produced by the action.
Source§

fn context(&self) -> ActionContext<()>

Poll for the action context. This is normally a service, but in some cases, it may be a frame handler or a router.
Source§

fn as_into_actionable(&self) -> BoxedAction<State>
where Self: Clone + Send + Sync + 'static, Args: Clone + Send + Sync + 'static, State: Clone + Send + Sync + 'static,

Convert this action into a type erased actionable service.
Source§

fn into_stream( self, state: State, ) -> (impl Stream<Item = Result<Frame>>, FrameOutbox)
where Self: Clone + Send + Sync + 'static, Args: Clone + Send + Sync + 'static, State: Clone + Send + Sync + 'static,

Use into_stream to turn the action into a stream and a stream handle. See [Actionable::into_stream] for more information.
Source§

fn ready(self, state: State) -> ReadyAction<Self, Args, State>
where Self: Clone + Send + 'static, Args: Clone + Send + 'static, State: Clone + Send + 'static,

Use with_state to turn the action into a stateful action, which can be used as a tower::Service.
Source§

fn candidate(self) -> CandidateAction<Self, Args, State>
where Self: Clone + Send + 'static, Args: Clone + Send + 'static, State: Clone + Send + 'static,

Create a Candidate actionable from the action, with the given state. Candidates can be “suspended” by boxing them for later.
Source§

fn active(self, state: State) -> ActiveAction
where Self: Clone + Send + Sync + 'static, Args: Clone + Send + Sync + 'static, State: Clone + Send + Sync + 'static,

Create an Active actionable from the action, with the given state.
Source§

impl<IntoFrame> Service<IntoFrame> for StatelessSystem
where IntoFrame: Into<Frame> + 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, _: &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
Source§

impl Service<Request<Body>> for StatelessSystem

Source§

type Response = Response<Body>

Responses given by the service.
Source§

type Error = Infallible

Errors produced by the service.
Source§

type Future = Pin<Box<dyn Future<Output = Result<<System<Stateless, ()> as Service<Request<Body>>>::Response, <System<Stateless, ()> as Service<Request<Body>>>::Error>> + Send>>

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, request: Request<Body>) -> Self::Future

Process the request and return the response asynchronously. Read more