pub struct Network {
pub node_id: String,
pub neighbors: Vec<String>,
pub all_nodes: Vec<String>,
/* private fields */
}
Fields§
§node_id: String
§neighbors: Vec<String>
§all_nodes: Vec<String>
Implementations§
Source§impl Network
impl Network
pub fn reply<Payload: Serialize + Clone>( &mut self, dest: String, msg_id: Option<u64>, in_reply_to: Option<u64>, payload: Payload, ) -> Result<()>
pub fn send<Payload: Serialize + Clone>( &mut self, dest: String, body: Body<Payload>, ) -> Result<()>
pub fn send_msg<Payload: Serialize + Clone>( &mut self, msg: Message<Payload>, ) -> Result<()>
Sourcepub fn set_sqrt_topology(&mut self)
pub fn set_sqrt_topology(&mut self)
sqrt(n) root nodes, all with sqrt(n)-1 children Each child connects to all the root nodes
pub fn set_mesh_topology(&mut self)
pub fn is_singleton(&self) -> bool
Auto Trait Implementations§
impl Freeze for Network
impl RefUnwindSafe for Network
impl !Send for Network
impl !Sync for Network
impl Unpin for Network
impl UnwindSafe for Network
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