pub enum NodeServiceCallback<T>where
T: Service,{
OnlyRequest(Box<dyn FnMut(T::Request) -> BoxFuture<'static, T::Response> + Send>),
WithId(Box<dyn FnMut(T::Request, RequestId) -> BoxFuture<'static, T::Response> + Send>),
WithInfo(Box<dyn FnMut(T::Request, ServiceInfo) -> BoxFuture<'static, T::Response> + Send>),
}Expand description
An enum capturing the various possible function signatures for service callbacks.
Variants§
OnlyRequest(Box<dyn FnMut(T::Request) -> BoxFuture<'static, T::Response> + Send>)
A callback that only takes in the request value
WithId(Box<dyn FnMut(T::Request, RequestId) -> BoxFuture<'static, T::Response> + Send>)
A callback that takes in the request value and the ID of the request
WithInfo(Box<dyn FnMut(T::Request, ServiceInfo) -> BoxFuture<'static, T::Response> + Send>)
A callback that takes in the request value and all available
Trait Implementations§
Source§impl<T: Service> From<NodeServiceCallback<T>> for AnyServiceCallback<T, ()>
impl<T: Service> From<NodeServiceCallback<T>> for AnyServiceCallback<T, ()>
Source§fn from(value: NodeServiceCallback<T>) -> Self
fn from(value: NodeServiceCallback<T>) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl<T> Freeze for NodeServiceCallback<T>
impl<T> !RefUnwindSafe for NodeServiceCallback<T>
impl<T> Send for NodeServiceCallback<T>
impl<T> !Sync for NodeServiceCallback<T>
impl<T> Unpin for NodeServiceCallback<T>
impl<T> !UnwindSafe for NodeServiceCallback<T>
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> 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