pub struct FifoA<T: ?Sized, D: DataBuf> { /* private fields */ }
Expand description

A First-In-First-Out queue of DSTs

let mut queue = ::stack_dst::FifoA::<str, [usize; 8]>::new();
queue.push_back_str("Hello");
queue.push_back_str("World");
assert_eq!(queue.pop_front().as_deref(), Some("Hello"));

Implementations

Construct a new (empty) list

Construct a new (empty) list using the provided buffer

Push a value at the top of the stack

Push a value to the end of the list (without using Unsize)

Compact the list (moving the read position to zero)

Checks if the queue is currently empty

Remove an item from the front of the list

Peek the front of the queue

Peek the front of the queue

Obtain an immutable iterator (yields references to items, in insertion order)

let mut list = ::stack_dst::FifoA::<str, [usize; 8]>::new();
list.push_back_str("Hello");
list.push_back_str("world");
let mut it = list.iter();
assert_eq!(it.next(), Some("Hello"));
assert_eq!(it.next(), Some("world"));
assert_eq!(it.next(), None);

Obtain a mutable iterator

let mut list = ::stack_dst::FifoA::<[u8], [usize; 8]>::new();
list.push_copied(&[1,2,3]);
list.push_copied(&[9]);
for v in list.iter_mut() {
    v[0] -= 1;
}
let mut it = list.iter();
assert_eq!(it.next(), Some(&[0,2,3][..]));
assert_eq!(it.next(), Some(&[8][..]));
assert_eq!(it.next(), None);

Push the contents of a string slice as an item onto the stack

Pushes a set of items (cloning out of the input slice)

let mut queue = FifoA::<[String],[usize; 16]>::new();
queue.push_cloned(&["1".to_owned()]);

Pushes a set of items (copying out of the input slice)

let mut queue = FifoA::<[usize],[usize; 4]>::new();
queue.push_copied(&[1]);

Trait Implementations

Formats the value using the given formatter. Read more

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

Executes the destructor for this type. 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.

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.