Enum jsonrpsee_server::MethodCallback
source · pub enum MethodCallback {
Sync(Arc<dyn Fn(Id<'_>, Params<'_>, usize) -> MethodResponse + Sync + Send, Global>),
Async(Arc<dyn Fn(Id<'static>, Params<'static>, usize, usize) -> Pin<Box<dyn Future<Output = MethodResponse> + Send, Global>> + Sync + Send, Global>),
Subscription(Arc<dyn Fn(Id<'_>, Params<'_>, MethodSink, SubscriptionState<'_>) -> Pin<Box<dyn Future<Output = Result<MethodResponse, Id<'static>>> + Send, Global>> + Sync + Send, Global>),
Unsubscription(Arc<dyn Fn(Id<'_>, Params<'_>, usize, usize) -> MethodResponse + Sync + Send, Global>),
}Expand description
Callback wrapper that can be either sync or async.
Variants§
Sync(Arc<dyn Fn(Id<'_>, Params<'_>, usize) -> MethodResponse + Sync + Send, Global>)
Synchronous method handler.
Async(Arc<dyn Fn(Id<'static>, Params<'static>, usize, usize) -> Pin<Box<dyn Future<Output = MethodResponse> + Send, Global>> + Sync + Send, Global>)
Asynchronous method handler.
Subscription(Arc<dyn Fn(Id<'_>, Params<'_>, MethodSink, SubscriptionState<'_>) -> Pin<Box<dyn Future<Output = Result<MethodResponse, Id<'static>>> + Send, Global>> + Sync + Send, Global>)
Subscription method handler.
Unsubscription(Arc<dyn Fn(Id<'_>, Params<'_>, usize, usize) -> MethodResponse + Sync + Send, Global>)
Unsubscription method handler.
Trait Implementations§
source§impl Clone for MethodCallback
impl Clone for MethodCallback
source§fn clone(&self) -> MethodCallback
fn clone(&self) -> MethodCallback
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for MethodCallback
impl Send for MethodCallback
impl Sync for MethodCallback
impl Unpin for MethodCallback
impl !UnwindSafe for MethodCallback
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