pub struct BoxCloneService<Request, Q> { /* private fields */ }Implementations§
Source§impl<Request, Q> BoxCloneService<Request, Q>where
Q: Send + 'static,
impl<Request, Q> BoxCloneService<Request, Q>where
Q: Send + 'static,
pub fn new<S>(inner: S) -> Selfwhere
S: Service<Request, QueryResponse = Q> + Clone + Send + Sync + 'static,
S::OnQueryFuture: Send + 'static,
S::OnMessageFuture: Send + 'static,
Trait Implementations§
Source§impl<Request, Q> Clone for BoxCloneService<Request, Q>
impl<Request, Q> Clone for BoxCloneService<Request, Q>
Source§impl<Request, Q> Service<Request> for BoxCloneService<Request, Q>
impl<Request, Q> Service<Request> for BoxCloneService<Request, Q>
type QueryResponse = Q
type OnQueryFuture = Pin<Box<dyn Future<Output = Option<Q>> + Send>>
type OnMessageFuture = Pin<Box<dyn Future<Output = ()> + Send>>
Source§fn on_query(&self, req: Request) -> Self::OnQueryFuture
fn on_query(&self, req: Request) -> Self::OnQueryFuture
Called when a query is received. Read more
Source§fn on_message(&self, req: Request) -> Self::OnMessageFuture
fn on_message(&self, req: Request) -> Self::OnMessageFuture
Called when a message is received.
Auto Trait Implementations§
impl<Request, Q> Freeze for BoxCloneService<Request, Q>
impl<Request, Q> !RefUnwindSafe for BoxCloneService<Request, Q>
impl<Request, Q> Send for BoxCloneService<Request, Q>
impl<Request, Q> Sync for BoxCloneService<Request, Q>
impl<Request, Q> Unpin for BoxCloneService<Request, Q>
impl<Request, Q> !UnwindSafe for BoxCloneService<Request, Q>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more