Skip to main content

MessagePayload

Enum MessagePayload 

Source
#[repr(u8)]
pub enum MessagePayload<'payload> { Hello(Hello<'payload>), HelloYourself(HelloYourself<'payload>), ProtocolError(ProtocolError<'payload>), ConnectionOpen(ConnectionOpen<'payload>), ConnectionAccept(ConnectionAccept<'payload>), ConnectionReject(ConnectionReject<'payload>), ConnectionClose(ConnectionClose<'payload>), RequestMessage(RequestMessage<'payload>), ChannelMessage(ChannelMessage<'payload>), Ping(Ping), Pong(Pong), }

Variants§

§

Hello(Hello<'payload>)

Sent by initiator to acceptor as the first message

§

HelloYourself(HelloYourself<'payload>)

Sent by acceptor back to initiator. Poetic on purpose, I’m not changing the name.

§

ProtocolError(ProtocolError<'payload>)

Sent by either peer when the counterpart has violated the protocol. The sender closes the transport immediately after sending this message. No reply is expected or valid.

§

ConnectionOpen(ConnectionOpen<'payload>)

Request a new virtual connection. This is sent on the desired connection ID, even though it doesn’t exist yet.

§

ConnectionAccept(ConnectionAccept<'payload>)

Accept a virtual connection request — sent on the connection ID requested.

§

ConnectionReject(ConnectionReject<'payload>)

Reject a virtual connection request — sent on the connection ID requested.

§

ConnectionClose(ConnectionClose<'payload>)

Close a virtual connection. Trying to close conn 0 is a protocol error.

§

RequestMessage(RequestMessage<'payload>)

§

ChannelMessage(ChannelMessage<'payload>)

§

Ping(Ping)

Liveness probe for dead-peer detection.

§

Pong(Pong)

Reply to a keepalive Ping.

Trait Implementations§

Source§

impl<'payload> Debug for MessagePayload<'payload>

Source§

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

Formats the value using the given formatter. Read more
Source§

impl<'payload, 'ʄ> Facet<'ʄ> for MessagePayload<'payload>
where 'payload: 'ʄ, 'ʄ: 'payload,

Source§

const SHAPE: &'static Shape

The shape of this type, including: whether it’s a Struct, an Enum, something else? Read more

Auto Trait Implementations§

§

impl<'payload> Freeze for MessagePayload<'payload>

§

impl<'payload> RefUnwindSafe for MessagePayload<'payload>

§

impl<'payload> Send for MessagePayload<'payload>

§

impl<'payload> !Sync for MessagePayload<'payload>

§

impl<'payload> Unpin for MessagePayload<'payload>

§

impl<'payload> UnsafeUnpin for MessagePayload<'payload>

§

impl<'payload> UnwindSafe for MessagePayload<'payload>

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.
Source§

impl<T> MaybeSend for T
where T: Send,