pub struct BufferSegments<T> { /* private fields */ }
Expand description

Segments read from a buffer, useful for when you have the message in a buffer and don’t want the extra copy of read_message.

Implementations§

Reads a serialized message (including a segment table) from a buffer and takes ownership, without copying. The buffer is allowed to be longer than the message. Provide this to Reader::new with options that make sense for your use case. Very long lived mmaps may need unlimited traversal limit.

ALIGNMENT: If the “unaligned” feature is enabled, then there are no alignment requirements on buffer. Otherwise, buffer must be 8-byte aligned (attempts to read the message will trigger errors).

Trait Implementations§

Gets the segment with index idx. Returns None if idx is out of range. Read more
Gets the number of segments.

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.

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.