pub struct ServiceRoot { /* private fields */ }Expand description
The service root: its table of peers. A handle (cheap to clone) onto a
DynamicHub — DynamicHub::root — that reads and changes its top
level while it serves.
Implementations§
Source§impl ServiceRoot
impl ServiceRoot
Sourcepub async fn peer(&self, name: &str) -> Result<Box<dyn Peer>, PeerError>
pub async fn peer(&self, name: &str) -> Result<Box<dyn Peer>, PeerError>
The primitive: the top-level peer name. The service’s own name is
not an entry (NotFound); call the service itself for its methods.
Sourcepub fn insert<A: Activation + ChildRouter + Clone + 'static>(
&self,
activation: A,
) -> Result<(), RootError>
pub fn insert<A: Activation + ChildRouter + Clone + 'static>( &self, activation: A, ) -> Result<(), RootError>
Serve activation at the top level under its namespace, while the
service serves; refused when the name is taken.
Sourcepub fn replace<A: Activation + ChildRouter + Clone + 'static>(
&self,
activation: A,
) -> Result<bool, RootError>
pub fn replace<A: Activation + ChildRouter + Clone + 'static>( &self, activation: A, ) -> Result<bool, RootError>
insert, replacing whatever was served under the
name; answers whether something was.
Sourcepub fn insert_peer(
&self,
name: impl Into<String>,
peer: Arc<dyn Peer>,
replace: bool,
) -> Result<bool, RootError>
pub fn insert_peer( &self, name: impl Into<String>, peer: Arc<dyn Peer>, replace: bool, ) -> Result<bool, RootError>
Serve any Peer at the top level as name (its schema’s grants
and roles requalified to name); replace takes the name over.
Answers whether something was replaced.
Sourcepub fn remove(&self, name: &str) -> bool
pub fn remove(&self, name: &str) -> bool
Stop serving name at the top level; answers whether it was served.
Trait Implementations§
Source§impl Clone for ServiceRoot
impl Clone for ServiceRoot
Auto Trait Implementations§
impl !RefUnwindSafe for ServiceRoot
impl !UnwindSafe for ServiceRoot
impl Forget for ServiceRoot
impl Freeze for ServiceRoot
impl Send for ServiceRoot
impl Sync for ServiceRoot
impl Unpin for ServiceRoot
impl UnsafeUnpin for ServiceRoot
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