#[non_exhaustive]
#[repr(u32)]
pub enum MapType {
Show 31 variants
Unspec,
Hash,
Array,
ProgArray,
PerfEventArray,
PerCpuHash,
PerCpuArray,
StackTrace,
CgroupArray,
LruHash,
LruPerCpuHash,
LpmTrie,
ArrayOfMaps,
HashOfMaps,
DevMap,
SockMap,
CpuMap,
XskMap,
SockHash,
CgroupStorage,
ReusePortSockArray,
PerCpuCgroupStorage,
Queue,
Stack,
SkStorage,
DevMapHash,
StructOps,
RingBuf,
InodeStorage,
TaskStorage,
BloomFilter,
}
Expand description
eBPF map type variants. Based off of kernel header’s
enum bpf_map_type
Variants (Non-exhaustive)
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Unspec
Hash
Array
ProgArray
PerfEventArray
PerCpuHash
PerCpuArray
StackTrace
CgroupArray
LruHash
LruPerCpuHash
LpmTrie
ArrayOfMaps
HashOfMaps
DevMap
SockMap
CpuMap
XskMap
SockHash
CgroupStorage
ReusePortSockArray
PerCpuCgroupStorage
Queue
Stack
SkStorage
DevMapHash
StructOps
RingBuf
InodeStorage
TaskStorage
BloomFilter
Implementations
sourceimpl MapType
impl MapType
sourcepub fn name(&self) -> &'static str
pub fn name(&self) -> &'static str
Based off of bpftool’s
map_type_name
,
returns a human-readable name of the eBPF map type.
sourcepub fn probe(&self) -> Result<bool, Error>
pub fn probe(&self) -> Result<bool, Error>
Determines if the eBPF map type is supported on the current platform
sourcepub fn iter() -> impl Iterator<Item = MapType>
pub fn iter() -> impl Iterator<Item = MapType>
Returns an ordered iterator over the MapType variants. The order is determined by the kernel header’s enum values.
Note: Skips MapType::Unspec
since it’s an invalid map type
Trait Implementations
sourceimpl TryFrom<u32> for MapType
impl TryFrom<u32> for MapType
type Error = TryFromPrimitiveError<MapType>
type Error = TryFromPrimitiveError<MapType>
The type returned in the event of a conversion error.
sourcefn try_from(number: u32) -> Result<Self, TryFromPrimitiveError<Self>>
fn try_from(number: u32) -> Result<Self, TryFromPrimitiveError<Self>>
Performs the conversion.
sourceimpl TryFromPrimitive for MapType
impl TryFromPrimitive for MapType
type Primitive = u32
const NAME: &'static str = "MapType"
fn try_from_primitive(
number: Self::Primitive
) -> Result<Self, TryFromPrimitiveError<Self>>
impl Copy for MapType
impl Eq for MapType
impl StructuralEq for MapType
impl StructuralPartialEq for MapType
Auto Trait Implementations
impl RefUnwindSafe for MapType
impl Send for MapType
impl Sync for MapType
impl Unpin for MapType
impl UnwindSafe for MapType
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more