pub struct RpcMgr { /* private fields */ }Expand description
Shared state, configuration, and data for all RPC sessions.
An RpcMgr knows how to listen for incoming RPC connections, and launch sessions based on them.
Implementations§
Source§impl RpcMgr
impl RpcMgr
Sourcepub fn register_rpc_methods<I>(&self, entries: I)where
I: IntoIterator<Item = InvokerEnt>,
pub fn register_rpc_methods<I>(&self, entries: I)where
I: IntoIterator<Item = InvokerEnt>,
Extend our method dispatch table with the method entries in entries.
Ignores any entries that
§Panics
Panics if any entries are conflicting, according to the logic of
DispatchTable::insert
Sourcepub fn with_dispatch_table<F, T>(&self, func: F) -> Twhere
F: FnOnce(&mut DispatchTable) -> T,
pub fn with_dispatch_table<F, T>(&self, func: F) -> Twhere
F: FnOnce(&mut DispatchTable) -> T,
Run func with a mutable reference to our dispatch table as an argument.
Used to register additional methods.
Sourcepub fn new_connection(
self: &Arc<Self>,
require_auth: RpcAuth,
) -> Arc<Connection>
pub fn new_connection( self: &Arc<Self>, require_auth: RpcAuth, ) -> Arc<Connection>
Start a new session based on this RpcMgr, with a given TorClient.
Sourcepub fn lookup_object(
&self,
id: &ObjectId,
) -> Result<(Arc<dyn Context>, Arc<dyn Object>), LookupError>
pub fn lookup_object( &self, id: &ObjectId, ) -> Result<(Arc<dyn Context>, Arc<dyn Object>), LookupError>
Look up an object in the context of this RpcMgr.
Some object identifiers exist in a manager-global context, so that they can be used outside of a single RPC session. This function looks up an object by such an identifier string. It returns an error if the identifier is invalid or the object does not exist.
Along with the object, this additionally returns the rpc::Context associated with the
object. That context can be used to invoke any special methods on the object.
Auto Trait Implementations§
impl !Freeze for RpcMgr
impl !RefUnwindSafe for RpcMgr
impl Send for RpcMgr
impl Sync for RpcMgr
impl Unpin for RpcMgr
impl !UnwindSafe for RpcMgr
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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> 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>
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>
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)
&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)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
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>
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