pub struct Endpoint<State>(/* private fields */);
Expand description
An action that can be invoked as a service.
Implementations§
Trait Implementations§
Source§impl<Args, State> Handler<Args, State> for Endpoint<State>
impl<Args, State> Handler<Args, State> for Endpoint<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.
Auto Trait Implementations§
impl<State> Freeze for Endpoint<State>
impl<State> !RefUnwindSafe for Endpoint<State>
impl<State> Send for Endpoint<State>
impl<State> Sync for Endpoint<State>
impl<State> Unpin for Endpoint<State>
impl<State> !UnwindSafe for Endpoint<State>
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