[][src]Struct membership::Node

pub struct Node { /* fields omitted */ }

Runs the gossip protocol on an internal thread.

Methods

impl Node[src]

pub fn new(bind_address: SocketAddr, config: ProtocolConfig) -> Self[src]

Creates new instance communicating with other members through bind_address.

pub fn set_logger(&mut self, logger: Logger)[src]

Set logger.

pub fn bind_address(&self) -> SocketAddr[src]

Returns bind address of this member.

pub fn join(&mut self, member: SocketAddr) -> Result<(), Error>[src]

Joins the group through member which has to already belong to the group.

Member might not be instantly spotted by all other members of the group.

pub fn start(&mut self) -> Result<(), Error>[src]

Starts new group.

pub fn stop(&mut self) -> Result<(), Error>[src]

Stops this member, removing it from the group.

Member does not broadcast that its quiting (at least not yet), thus it may still be observed by others as alive, at least for a short period of time.

pub fn get_members(&self) -> Result<Vec<SocketAddr>, Error>[src]

Returns all alive members of the group this member knows about.

These might not necessary be all alive members in the entire group.

Auto Trait Implementations

impl !RefUnwindSafe for Node

impl Send for Node

impl !Sync for Node

impl Unpin for Node

impl !UnwindSafe for Node

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<T> From<T> for T[src]

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

impl<T> Same<T> for T

type Output = T

Should always be Self

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>,