Enum rxdp::MapValue [−][src]
Return value from eBPF maps.
Variants
Result from cpu-shared maps.
Multi(Vec<V>)
Result from per-cpu maps.
Implementations
impl<V> MapValue<V>
[src]
pub fn into_vec(self) -> Vec<V>
[src]
Convert the map value into a Vec<V>
:
use rxdp::MapValue; assert_eq!(MapValue::Multi(vec![1u32]).into_vec(), vec![1u32]); assert_eq!(MapValue::Single(1u32).into_vec(), vec![1u32]);
pub fn into_single(self) -> V
[src]
Convert the map value into a V
. For the Multi
variant, this will take the first
element of the Vec
:
use rxdp::MapValue; assert_eq!(MapValue::Multi(vec![1u32, 2u32]).into_single(), 1u32); assert_eq!(MapValue::Single(1u32).into_single(), 1u32);
Panics
Panics if len of Vec
in Multi is 0.
Trait Implementations
impl<V: Debug> Debug for MapValue<V>
[src]
impl<V: Eq> Eq for MapValue<V>
[src]
impl<V: PartialEq> PartialEq<MapValue<V>> for MapValue<V>
[src]
impl<V> StructuralEq for MapValue<V>
[src]
impl<V> StructuralPartialEq for MapValue<V>
[src]
Auto Trait Implementations
impl<V> RefUnwindSafe for MapValue<V> where
V: RefUnwindSafe,
V: RefUnwindSafe,
impl<V> Send for MapValue<V> where
V: Send,
V: Send,
impl<V> Sync for MapValue<V> where
V: Sync,
V: Sync,
impl<V> Unpin for MapValue<V> where
V: Unpin,
V: Unpin,
impl<V> UnwindSafe for MapValue<V> where
V: UnwindSafe,
V: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,