pub struct Message<'a> { /* private fields */ }
Expand description

A message writing into a preallocated buffer

Implementations§

Create a MutableWritableMessage on a buffer that already contains a serialized message

While this is generally not useful (a parsed message has its paylod already set, and if there’s no payload, there’s no space to add options or any payload), it allows mutable access to the option bytes and the payload. This is primarily useful in situations when data is processed in place, eg. decrypted (in OSCORE), or CBOR is shifted around to get contiguous slices out of indefinite length strings.

Return the number of bytes that wee populated inside tail

Trait Implementations§

Add an option to the message Read more
Copy code, options and payload in from a readable message Read more
Shortcut for add_option(self, number, value.as_bytes()). Read more
Shortcut for add_option on a buffer containing the uint encoded value Read more
Number of bytes available for additional options, payload marker and payload
👎Deprecated since 0.1.1: Use payload_mut_with_len instead
Legacy method for mutable access to the payload Read more
Memory-map len bytes of the payload for writing Read more
Truncate an already-set payload to the given length; that payload must have been written to before using MinimalWritableMessage::set_payload, or with a suitable MutableWritableMessage::payload_mut_with_len call.
Apply a callback to all options in sequence Read more
Type of an individual option, indiciating its option number and value
Get the code (request method or response code) of the message Read more
Get the payload set in the message Read more
Produce all options in arbitrary order as an iterator Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.