Struct roughenough::RtMessage[][src]

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 Debug for RtMessage
[src]

Formats the value using the given formatter. Read more

impl Clone for RtMessage
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Auto Trait Implementations

impl Send for RtMessage

impl Sync for RtMessage