pub struct StackBuffer<T, const N: usize>(_);
Available on crate feature stack-buffer only.
Expand description

Backing buffer for a queue, allocated on the stack.

All queues require a backing buffer which implements the Storage trait. This buffer stores values in a contiguous array allocated on the stack. Compare this to HeapBuffer which uses a contiguous array on the heap. Note that both the asyncio and nonblocking queues move their buffer to the heap anyway.

Example

use mini_io_queue::nonblocking;
use mini_io_queue::storage::StackBuffer;

let buffer: StackBuffer<u8, 100> = StackBuffer::default();
let (reader, writer) = nonblocking::queue_from(buffer);

Trait Implementations

Converts this type into a shared reference of the (usually inferred) input type.

Returns the “default value” for a type. Read more

Converts to this type from the input type.

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.

Gets the capacity of the array, or in other words the upper bound for ranges passed into slice and slice_mut before they will panic. Read more

Gets a slice of elements in the range provided. The length of the slice will always match the length of the range. Read more

Gets a mutable slice of elements in the range provided. The length of the slice will always match the length of the range. This function is unchecked and unsafe because it does not ensure there are no other references overlapping with the range, which is against Rust’s borrowing rules and is very unsafe! Read more

Gets a mutable slice of elements in the range provided. The length of the slice will always match the length of the range. Read more

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.