#[non_exhaustive]#[repr(u32)]pub enum MapType {
Show 33 variants
Unspec = 0,
Hash = 1,
Array = 2,
ProgArray = 3,
PerfEventArray = 4,
PercpuHash = 5,
PercpuArray = 6,
StackTrace = 7,
CgroupArray = 8,
LruHash = 9,
LruPercpuHash = 10,
LpmTrie = 11,
ArrayOfMaps = 12,
HashOfMaps = 13,
Devmap = 14,
Sockmap = 15,
Cpumap = 16,
Xskmap = 17,
Sockhash = 18,
CgroupStorage = 19,
ReuseportSockarray = 20,
PercpuCgroupStorage = 21,
Queue = 22,
Stack = 23,
SkStorage = 24,
DevmapHash = 25,
StructOps = 26,
RingBuf = 27,
InodeStorage = 28,
TaskStorage = 29,
BloomFilter = 30,
UserRingBuf = 31,
Unknown = 4_294_967_295,
}
Expand description
Type of a Map
. Maps to enum bpf_map_type
in kernel uapi.
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 = 0
Hash = 1
Array = 2
ProgArray = 3
PerfEventArray = 4
PercpuHash = 5
PercpuArray = 6
StackTrace = 7
CgroupArray = 8
LruHash = 9
LruPercpuHash = 10
LpmTrie = 11
ArrayOfMaps = 12
HashOfMaps = 13
Devmap = 14
Sockmap = 15
Cpumap = 16
Xskmap = 17
Sockhash = 18
CgroupStorage = 19
ReuseportSockarray = 20
PercpuCgroupStorage = 21
Queue = 22
Stack = 23
SkStorage = 24
DevmapHash = 25
StructOps = 26
RingBuf = 27
InodeStorage = 28
TaskStorage = 29
BloomFilter = 30
UserRingBuf = 31
Unknown = 4_294_967_295
We choose to specify our own “unknown” type here b/c it’s really up to the kernel to decide if it wants to reject the map. If it accepts it, it just means whoever using this library is a bit out of date.
Implementations§
Source§impl MapType
impl MapType
Sourcepub fn is_bloom_filter(&self) -> bool
pub fn is_bloom_filter(&self) -> bool
Returns if the map is of bloom filter type
Sourcepub fn is_supported(&self) -> Result<bool>
pub fn is_supported(&self) -> Result<bool>
Detects if host kernel supports this BPF map type.
Make sure the process has required set of CAP_* permissions (or runs as root) when performing feature checking.
Trait Implementations§
impl Copy for MapType
impl Eq for MapType
impl StructuralPartialEq for MapType
Auto Trait Implementations§
impl Freeze for MapType
impl RefUnwindSafe for MapType
impl Send for MapType
impl Sync for MapType
impl Unpin for MapType
impl UnwindSafe for MapType
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)