pub struct DispatchTable { /* private fields */ }
Expand description
A collection of method implementations for different method and object types.
A DispatchTable is constructed at run-time from entries registered with
static_rpc_invoke_fn!
.
There is one for each arti-rpcserver::RpcMgr
, shared with each arti-rpcserver::Connection
.
Implementations§
Source§impl DispatchTable
impl DispatchTable
Sourcepub fn dispatch_information(&self) -> RpcDispatchInformation
Available on crate feature describe-methods
only.
pub fn dispatch_information(&self) -> RpcDispatchInformation
describe-methods
only.Return a description for all of the RPC methods available, which types they expect and return, and which objects they apply to.
Currently, the resulting object is good for nothing but serialization.
Source§impl DispatchTable
impl DispatchTable
Sourcepub fn from_inventory() -> Self
pub fn from_inventory() -> Self
Construct a DispatchTable
from the entries registered statically via
static_rpc_invoke_fn!
.
§Panics
Panics if two entries are found for the same (method,object) types.
Sourcepub fn insert(&mut self, ent: InvokerEnt)
pub fn insert(&mut self, ent: InvokerEnt)
Add a new entry to this DispatchTable.
§Panics
Panics if there was a previous entry inserted with the same (Object,Method) pair, but (apparently) with a different implementation function, or from a macro invocation.
Sourcepub fn extend<I>(&mut self, ents: I)where
I: IntoIterator<Item = InvokerEnt>,
pub fn extend<I>(&mut self, ents: I)where
I: IntoIterator<Item = InvokerEnt>,
Trait Implementations§
Source§impl Clone for DispatchTable
impl Clone for DispatchTable
Source§fn clone(&self) -> DispatchTable
fn clone(&self) -> DispatchTable
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreAuto Trait Implementations§
impl Freeze for DispatchTable
impl !RefUnwindSafe for DispatchTable
impl Send for DispatchTable
impl Sync for DispatchTable
impl Unpin for DispatchTable
impl !UnwindSafe for DispatchTable
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
, which can then be
downcast
into Box<dyn ConcreteType>
where ConcreteType
implements Trait
.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
, which can then be further
downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.