[][src]Struct roughenough::RtMessage

pub struct RtMessage { /* fields omitted */ }

A Roughtime protocol message; a map of u32 tags to arbitrary byte-strings.

Methods

impl RtMessage
[src]

Construct a new RtMessage

Arguments

  • num_fields - Reserve space for this many fields.

Construct a new RtMessage from the on-the-wire representation in bytes

Arguments

  • bytes - On-the-wire representation

Add a field to this RtMessage

Arguments

Retrieve the value associated with tag, if present.

Arguments

  • tag - The Tag to try and retrieve.

Returns the number of tag/value pairs in the message

Returns a slice of the tags in the message

Returns a slice of the values in the message

Converts the message into a HashMap mapping each tag to its value

Encode this message into its on-the-wire representation.

Returns the length in bytes of this message's on-the-wire representation.

Adds a PAD tag to the end of this message, with a length set such that the final encoded size of this message is 1KB

If the encoded size of this message is already >= 1KB, this method does nothing

Trait Implementations

impl Clone for RtMessage
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Debug for RtMessage
[src]

Formats the value using the given formatter. Read more

Auto Trait Implementations

impl Send for RtMessage

impl Sync for RtMessage

Blanket Implementations

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

Performs the conversion.

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

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

impl<T> From for T
[src]

Performs the conversion.

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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

🔬 This is a nightly-only experimental API. (try_from)

Performs the conversion.

impl<T> Borrow for T where
    T: ?Sized
[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut for T where
    T: ?Sized
[src]

Mutably borrows from an owned value. Read more

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

🔬 This is a nightly-only experimental API. (try_from)

Performs the conversion.

impl<T> Any for T where
    T: 'static + ?Sized
[src]

🔬 This is a nightly-only experimental API. (get_type_id)

this method will likely be replaced by an associated static

Gets the TypeId of self. Read more