Struct plumtree::Node[][src]

pub struct Node<T: System> { /* fields omitted */ }

Plumtree node.

User's responsibility

For running a node correctly, you have to call the following methods appropriately:

For details, refer to the document of each method.

Methods

impl<T: System> Node<T>
[src]

Makes a new Node instance.

Makes a new Node instance with the given options.

Returns the identifier of the node.

Returns the options of the node.

Returns a mutable reference to the options of the node.

Returns the peers with which the node uses eager push gossip for diffusing application messages.

Returns the peers with which the node uses lazy push gossip for diffusing application messages.

Broadcasts the given message.

Returns a reference to the messages kept by the node.

Returns the number of messages waiting to be received.

Roughly speaking, it indicates the approximate number of IHAVE messages held by the node.

Forgets the specified message.

If the node does not have the target message, this method will return false.

For preventing memory shortage, this method needs to be called appropriately.

Polls the next action that the node wants to execute.

Handles the given incoming message.

This method will return false if the sender of the message is not a neighbor of this node.

Accepts new neighbor.

Removes downed neighbor.

Returns a reference to the clock of the node.

Returns a mutable reference to the clock of the node.

Note that for handling IHAVE messages correctly, you have to proceed the time of the node by calling Clock::tick method.

Returns the nearest time when the timeout of a IHAVE message expires.

If the node has no IHAVE messages to be handled, this method will return None.

Trait Implementations

impl<T: System> Debug for Node<T> where
    T::NodeId: Debug,
    T::MessageId: Debug,
    T::MessagePayload: Debug
[src]

Formats the value using the given formatter. Read more

Auto Trait Implementations

impl<T> Send for Node<T> where
    <T as System>::MessageId: Send,
    <T as System>::MessagePayload: Send,
    <T as System>::NodeId: Send

impl<T> Sync for Node<T> where
    <T as System>::MessageId: Sync,
    <T as System>::MessagePayload: Sync,
    <T as System>::NodeId: Sync