Struct Hub
pub struct Hub { /* private fields */ }Implementations§
§impl Hub
impl Hub
pub async fn new( tls_config: TlsConfig, listen_addr: String, shutdown: CancellationToken, ) -> Result<Self>
pub fn get_id(&self) -> NodeID
pub fn signing_key(&self) -> Arc<NodeSigningKey>
pub async fn wait_for_shutdown(&self)
pub async fn add_peer(&self, id: &NodeID, addr: &str) -> Result<(), HubError>
pub async fn wait_inbound_ready( &self, id: &NodeID, timeout: Duration, ) -> Result<RequestReceiver, HubError>
pub async fn wait_outbound_ready( &self, id: &NodeID, timeout: Duration, ) -> Result<RequestSender, HubError>
pub async fn remove_peer(&self, id: &NodeID) -> Result<(), HubError>
pub fn outbound(&self, id: &NodeID) -> Result<RequestSender, HubError>
pub fn inbound(&self, id: &NodeID) -> Result<RequestReceiver, HubError>
pub fn rpc_outbound(&self, id: &NodeID) -> Result<RPCSender, HubError>
pub fn rpc_inbound(&self) -> Result<RPCReceiver, HubError>
pub async fn get_peers(&self) -> Vec<NodeID>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Hub
impl !RefUnwindSafe for Hub
impl Send for Hub
impl Sync for Hub
impl Unpin for Hub
impl UnsafeUnpin for Hub
impl !UnwindSafe for Hub
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§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
Mutably borrows from an owned value. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Applies the layer to a service and wraps it in [
Layered].