Enum Action

Source
pub enum Action<T: System> {
    Send {
        destination: T::NodeId,
        message: ProtocolMessage<T>,
    },
    Deliver {
        message: Message<T>,
    },
}
Expand description

Actions instructed by Plumtree Node.

For running Plumtree nodes, the actions must be handled correctly by upper layers.

Variants§

§

Send

Send a message.

If it is failed to send the message (e.g., the destination node does not exist), the message will be discarded silently.

Fields

§destination: T::NodeId

The destination of the message.

§message: ProtocolMessage<T>

The outgoing message.

§

Deliver

Deliver a message to the applications waiting for messages.

Fields

§message: Message<T>

The message to be delivered.

Trait Implementations§

Source§

impl<T: System> Debug for Action<T>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<T> Freeze for Action<T>
where <T as System>::NodeId: Freeze, <T as System>::MessageId: Freeze, <T as System>::MessagePayload: Freeze,

§

impl<T> RefUnwindSafe for Action<T>

§

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

§

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

§

impl<T> Unpin for Action<T>
where <T as System>::NodeId: Unpin, <T as System>::MessageId: Unpin, <T as System>::MessagePayload: Unpin,

§

impl<T> UnwindSafe for Action<T>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.