Struct aya::maps::queue::Queue[][src]

pub struct Queue<T: Deref<Target = Map>, V: Pod> { /* fields omitted */ }
Expand description

A FIFO queue.

Examples

use aya::maps::Queue;
use std::convert::TryFrom;

let mut queue = Queue::try_from(bpf.map_mut("ARRAY")?)?;
queue.push(42, 0)?;
queue.push(43, 0)?;
assert_eq!(queue.pop(0)?, 42);

Implementations

Returns the number of elements the queue can hold.

This corresponds to the value of bpf_map_def::max_entries on the eBPF side.

Removes the first element and returns it.

Errors

Returns MapError::ElementNotFound if the queue is empty, MapError::SyscallError if bpf_map_lookup_and_delete_elem fails.

Appends an element at the end of the queue.

Errors

MapError::SyscallError if bpf_map_update_elem fails.

Trait Implementations

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.

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

Performs the conversion.

Performs the conversion.

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.