Struct aya::maps::stack::Stack [−][src]
Expand description
A LIFO stack.
Examples
use aya::maps::Stack; use std::convert::TryFrom; let mut stack = Stack::try_from(bpf.map_mut("STACK")?)?; stack.push(42, 0)?; stack.push(43, 0)?; assert_eq!(stack.pop(0)?, 43);
Implementations
Removes the last element and returns it.
Errors
Returns MapError::ElementNotFound
if the stack is empty, MapError::SyscallError
if bpf_map_lookup_and_delete_elem
fails.
Trait Implementations
Auto Trait Implementations
impl<T, V> RefUnwindSafe for Stack<T, V> where
T: RefUnwindSafe,
V: RefUnwindSafe,
impl<T, V> UnwindSafe for Stack<T, V> where
T: UnwindSafe,
V: UnwindSafe,