Struct ratman_netmod::SeqBuilder [−][src]
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
impl RefUnwindSafe for SeqBuilder
impl Send for SeqBuilder
impl Sync for SeqBuilder
impl Unpin for SeqBuilder
impl UnwindSafe for SeqBuilder
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
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]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,