Enum hyparview::Action [−][src]
pub enum Action<T> { Send { destination: T, message: ProtocolMessage<T>, }, Disconnect { node: T, }, Notify { event: Event<T>, }, }
Actions instructed by HyParView Node.
For running HyParView nodes, the users must handle the actions correctly.
Variants
Send
Send a message.
If there is no existing connection between the sender and the destination, new connection should be established automatically.
If the destination node does not exist, the message will be discarded silently.
Although it is not recommended, it is acceptable for discarding some messages if the load of networks (or systems) are too high.
Fields of Send
destination: T | The ID of the destination node of the message. |
message: ProtocolMessage<T> | An outgoing message. |
Disconnect
Close a connection.
The connection between the local node and node
must be disconnected.
If there is no such connection, this action will be silently ignored.
Fields of Disconnect
node: T | The ID of the target node. |
Notify
Notify an event.
If there are some listeners that monitoring HyPerView events, the events emitted by nodes should be notified to them.
Fields of Notify
event: Event<T> | An event emitted by a HyParView Node. |
Trait Implementations
impl<T: Debug> Debug for Action<T>
[src]
impl<T: Debug> Debug for Action<T>
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl<T: PartialEq> PartialEq for Action<T>
[src]
impl<T: PartialEq> PartialEq for Action<T>
fn eq(&self, other: &Action<T>) -> bool
[src]
fn eq(&self, other: &Action<T>) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Action<T>) -> bool
[src]
fn ne(&self, other: &Action<T>) -> bool
This method tests for !=
.
impl<T: Eq> Eq for Action<T>
[src]
impl<T: Eq> Eq for Action<T>