Struct ratman_netmod::SeqBuilder[][src]

pub struct SeqBuilder { /* fields omitted */ }

Utility wrapping around Vec<Frame> with SeqId initialisation.

This type implements a builder, which is initialised with header data, then filled with various sliced payloads, and then made into a frame sequence, as outlined in the root netmod docs.

Implementations

impl SeqBuilder[src]

pub fn new(sender: Identity, recp: Recipient, seqid: SeqId) -> Self[src]

Initialise a Sequence builder

pub fn add(self, data: Vec<u8>) -> Self[src]

Add a slice of payload to the sequence set

pub fn build(self) -> Vec<Frame>[src]

Consume the builder into a set of frames

pub fn restore(buf: &mut Vec<Frame>) -> Vec<u8>[src]

Take a sequence of frames and turn it into a complete payload

This function assumes a complete set of frame that has previously been sorted along the seq.num metric.

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

Read the sequence ID back from the builder

pub fn sender(&self) -> Identity[src]

Read the sender back from the builder

pub fn recp(&self) -> Recipient[src]

Read the recipient back from the builder

pub fn data(&self) -> Vec<u8>[src]

Read the payload data set back from the builder

Auto Trait Implementations

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