[][src]Struct splinter::network::dispatch::MessageContext

pub struct MessageContext<MT: Hash + Eq + Debug + Clone> { /* fields omitted */ }

The Message Context

The message context provides information about an incoming message beyond its parsed bytes. It includes the source peer id, the message type, the original bytes, and potentially other, future items.

Methods

impl<MT: Hash + Eq + Debug + Clone> MessageContext<MT>[src]

pub fn source_peer_id(&self) -> &str[src]

The Source Peer ID.

This is the peer id of the original sender of the message

pub fn message_type(&self) -> &MT[src]

The Message Type.

This is the message type that determined which handler to execute on receipt of this message.

pub fn message_bytes(&self) -> &[u8][src]

The raw message bytes.

Trait Implementations

impl<MT: Clone + Hash + Eq + Debug> Clone for MessageContext<MT>[src]

impl<MT: Debug + Hash + Eq + Clone> Debug for MessageContext<MT>[src]

Auto Trait Implementations

impl<MT> RefUnwindSafe for MessageContext<MT> where
    MT: RefUnwindSafe

impl<MT> Send for MessageContext<MT> where
    MT: Send

impl<MT> Sync for MessageContext<MT> where
    MT: Sync

impl<MT> Unpin for MessageContext<MT> where
    MT: Unpin

impl<MT> UnwindSafe for MessageContext<MT> where
    MT: UnwindSafe

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<'a, T> DefaultFeatures<'a> for T where
    T: 'a + Clone + Send + Sync

impl<T> From<T> for T[src]

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

impl<T> IntoSql for T

impl<'a, T> NonSyncFeatures<'a> for T where
    T: 'a + Clone

impl<T> SafeBorrow<T> for T where
    T: ?Sized

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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