pub enum Frame {
Unit,
Error(Bytes),
Anonymous(Bytes),
Message(MessageFrame),
}
Expand description
A frame that can be processed by an action.
Variants§
Unit
A unit frame, with nothing in it.
Error(Bytes)
An error frame.
Anonymous(Bytes)
An unaddressed chunk of bytes.
Message(MessageFrame)
An addressed frame.
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Frame
impl<'de> Deserialize<'de> for Frame
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<State> Extractor<State> for Frame
impl<State> Extractor<State> for Frame
Source§type Error = Infallible
type Error = Infallible
The error type for this extractor. Anything that can be converted into an extractor error
can be used as an error type. Read more
Source§fn extract(
frame: Frame,
_: &Context<State>,
) -> Result<Self, <Frame as Extractor<State>>::Error>
fn extract( frame: Frame, _: &Context<State>, ) -> Result<Self, <Frame as Extractor<State>>::Error>
Take an frame and a state and return a result containing the extracted value or the frame.
Source§impl From<Frame> for HttpFrameResponse
impl From<Frame> for HttpFrameResponse
Source§impl From<HttpFrameResponse> for Frame
impl From<HttpFrameResponse> for Frame
Source§fn from(frame: HttpFrameResponse) -> Self
fn from(frame: HttpFrameResponse) -> Self
Converts to this type from the input type.
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<State> Handler<Frame, State> for System<Open, State>
impl<State> Handler<Frame, State> for System<Open, State>
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>, state: State) -> Self::Future
fn invoke(&self, frame: impl Into<Frame>, state: State) -> 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<State>
fn context(&self) -> ActionContext<State>
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<State> Handler<Frame, State> for StatefulSystem<State>
impl<State> Handler<Frame, State> for StatefulSystem<State>
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>, state: State) -> Self::Future
fn invoke(&self, frame: impl Into<Frame>, state: State) -> 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<State>
fn context(&self) -> ActionContext<State>
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.
impl StructuralPartialEq for Frame
Auto Trait Implementations§
impl !Freeze for Frame
impl RefUnwindSafe for Frame
impl Send for Frame
impl Sync for Frame
impl Unpin for Frame
impl UnwindSafe for Frame
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more