pub struct LeasableMutableBuffer<'a, T> { /* private fields */ }
Expand description

Leasable buffer which can be used to pass a section of a larger mutable buffer but still get the entire buffer back in a callback

Implementations

Create a leasable buffer from a passed reference to a raw buffer

Retrieve the raw buffer used to create the LeasableBuffer. Consumes the LeasableBuffer.

Resets the LeasableBuffer to its full size, making the entire buffer accessible again. Typically this would be called once a sliced LeasableBuffer is returned through a callback

Returns the length of the currently accessible portion of the LeasableBuffer

Returns a pointer to the currently accessible portion of the LeasableBuffer

Reduces the range of the LeasableBuffer that is accessible. This should be called whenever an upper layer wishes to pass only a portion of a larger buffer down to a lower layer. For example: if the application layer has a 1500 byte packet buffer, but wishes to send a 250 byte packet, the upper layer should slice the LeasableBuffer down to its first 250 bytes before passing it down.

Trait Implementations

Formats the value using the given formatter. Read more

The returned type after indexing.

Performs the indexing (container[index]) operation. Read more

Performs the mutable indexing (container[index]) operation. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

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.