Struct ratman_netmod::Frame[][src]

pub struct Frame {
    pub sender: Identity,
    pub recipient: Recipient,
    pub seq: SeqData,
    pub payload: Vec<u8>,
}

A sequence of data, represented by a single network packet

Because a Frame is usually created in a sequence, the constructors assume chainable operations, such as a Vec<Frame> can be returned with all sequence ID information correctly setup.

Fields

sender: Identity

Sender information

recipient: Recipient

Recipient information

seq: SeqData

Data sequence identifiers

payload: Vec<u8>

Raw data payload

Implementations

impl Frame[src]

pub fn dummy() -> Self[src]

Produce a new dummy frame that sends nonsense data from nowhere to everyone.

pub fn inline_flood(sender: Identity, payload: Vec<u8>) -> Frame[src]

Build a one-off frame with inline payload

pub fn seqid(&self) -> SeqId[src]

Return the sequence Id of a frame

Trait Implementations

impl Clone for Frame[src]

impl Debug for Frame[src]

impl<'de> Deserialize<'de> for Frame[src]

impl PartialEq<Frame> for Frame[src]

impl Serialize for Frame[src]

impl StructuralPartialEq for Frame[src]

Auto Trait Implementations

impl RefUnwindSafe for Frame

impl Send for Frame

impl Sync for Frame

impl Unpin for Frame

impl UnwindSafe for Frame

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<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

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

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

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