Struct jsonrpsee_core::server::rpc_module::MethodCallback
source · pub struct MethodCallback { /* private fields */ }
Available on crate feature
server
only.Expand description
Method callback wrapper that contains a sync or async closure, plus a table with resources it needs to claim to run
Implementations§
source§impl MethodCallback
impl MethodCallback
sourcepub fn claim(
&self,
name: &str,
resources: &Resources
) -> Result<ResourceGuard, Error>
pub fn claim( &self, name: &str, resources: &Resources ) -> Result<ResourceGuard, Error>
Attempt to claim resources prior to executing a method. On success returns a guard that releases claimed resources when dropped.
sourcepub fn inner(&self) -> &MethodKind
pub fn inner(&self) -> &MethodKind
Get handle to the callback.
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