[][src]Struct splinter::network::Network

pub struct Network { /* fields omitted */ }

Methods

impl Network[src]

pub fn new(
    mesh: Mesh,
    heartbeat_interval: u64
) -> Result<Self, NetworkStartUpError>
[src]

pub fn peer_ids(&self) -> Vec<String>[src]

pub fn get_peer_endpoint(&self, peer_id: &str) -> Option<String>[src]

pub fn get_peer_by_endpoint(&self, endpoint: &str) -> Option<String>[src]

pub fn add_disconnect_listener(&self, listener: Box<dyn DisconnectListener>)[src]

pub fn add_connection(
    &self,
    connection: Box<dyn Connection>
) -> Result<String, ConnectionError>
[src]

pub fn remove_connection(&self, peer_id: &str) -> Result<(), ConnectionError>[src]

pub fn add_peer(
    &self,
    peer_id: String,
    connection: Box<dyn Connection>
) -> Result<(), ConnectionError>
[src]

Adds a peer with a given id.

Note that while this peer id is specified explicitly, the connection will still require to complete the authorization handshake, at which point its node id that the remote connection has identified itself with may replace the given id.

pub fn update_peer_id(
    &self,
    old_id: String,
    new_id: String
) -> Result<(), PeerUpdateError>
[src]

pub fn send(&self, peer_id: &str, msg: &[u8]) -> Result<(), SendError>[src]

pub fn recv(&self) -> Result<NetworkMessageWrapper, RecvError>[src]

pub fn recv_timeout(
    &self,
    timeout: Duration
) -> Result<NetworkMessageWrapper, RecvTimeoutError>
[src]

Trait Implementations

impl Clone for Network[src]

Auto Trait Implementations

impl !RefUnwindSafe for Network

impl Send for Network

impl !Sync for Network

impl Unpin for Network

impl !UnwindSafe for Network

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<'a, T> DefaultFeatures<'a> for T where
    T: 'a + Clone + Send + Sync

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> IntoSql for T

impl<'a, T> NonSyncFeatures<'a> for T where
    T: 'a + Clone

impl<T> SafeBorrow<T> for T where
    T: ?Sized

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,