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 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
Returns a duplicate 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 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
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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Converts
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
, which can then be
downcast
into Box<dyn ConcreteType>
where ConcreteType
implements Trait
.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Converts
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
, which can then be further
downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Converts
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Converts
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.