Struct mesh::local_node::LocalNode
source · pub struct LocalNode { /* private fields */ }
Expand description
The core local node implementation for the transport-specific meshes.
Implementations§
source§impl LocalNode
impl LocalNode
sourcepub fn with_id(node_id: NodeId, connector: Box<dyn Connect>) -> LocalNode
pub fn with_id(node_id: NodeId, connector: Box<dyn Connect>) -> LocalNode
Creates a new node with node_id
, using connector
to establish
connections to remote nodes.
sourcepub async fn wait_for_ports(&self, all_ports: bool)
pub async fn wait_for_ports(&self, all_ports: bool)
Waits for all ports to be disassociated from the node.
If all_ports
is false, only waits for ports that are still in the
process of being sent to another node.
pub fn drop_connector(&self)
pub fn fail_all_nodes(&self)
pub fn add_port(&self, id: PortId, peer: Address) -> Port
sourcepub fn add_remote(&self, id: NodeId) -> RemoteNodeHandle
pub fn add_remote(&self, id: NodeId) -> RemoteNodeHandle
Adds a new remote node.
sourcepub fn get_remote_handle(&self, id: NodeId) -> RemoteNodeHandle
pub fn get_remote_handle(&self, id: NodeId) -> RemoteNodeHandle
Retrieves a handle to a remote node. When the last handle is dropped, the node will be disconnected.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for LocalNode
impl !RefUnwindSafe for LocalNode
impl Send for LocalNode
impl Sync for LocalNode
impl Unpin for LocalNode
impl !UnwindSafe for LocalNode
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