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
impl StatelessSystem
Sourcepub fn handle_frame(self, frame: Frame) -> FrameFuture ⓘ
pub fn handle_frame(self, frame: Frame) -> FrameFuture ⓘ
Call the system with a frame.
Trait Implementations§
Source§impl Handler<Frame, ()> for StatelessSystem
impl Handler<Frame, ()> for StatelessSystem
Source§type Future = FrameFuture
type Future = FrameFuture
Action futures must resolve into an Frame of some kind.
Source§fn invoke(&self, frame: impl Into<Frame>, _: ()) -> Self::Future
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<()>
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>
fn as_into_actionable(&self) -> BoxedAction<State>
Convert this action into a type erased actionable service.
Source§fn into_stream(
self,
state: State,
) -> (impl Stream<Item = Result<Frame>>, FrameOutbox)
fn into_stream( self, state: State, ) -> (impl Stream<Item = Result<Frame>>, FrameOutbox)
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>
fn ready(self, state: State) -> ReadyAction<Self, Args, State>
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>
fn candidate(self) -> CandidateAction<Self, Args, State>
Create a Candidate actionable from the action, with the given state. Candidates
can be “suspended” by boxing them for later.
Source§impl<IntoFrame> Service<IntoFrame> for StatelessSystem
impl<IntoFrame> Service<IntoFrame> for StatelessSystem
Source§impl Service<Request<Body>> for StatelessSystem
impl Service<Request<Body>> for StatelessSystem
Source§type Error = Infallible
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>>
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.