Struct libbpf_rs::Map [−][src]
pub struct Map { /* fields omitted */ }Expand description
Represents a created map.
Some methods require working with raw bytes. You may find libraries such as
plain helpful.
Implementations
Value size in bytes
Returns map value as Vec of u8.
key must have exactly Map::key_size() elements.
If the map is one of the per-cpu data structures, the function Map::lookup_percpu()
must be used.
Returns one value per cpu as Vec of Vec of u8 for per per-cpu maps.
For normal maps, Map::lookup() must be used.
Deletes an element from the map.
key must have exactly Map::key_size() elements.
Same as Map::lookup() except this also deletes the key from the map.
Note that this operation is currently only implemented in the kernel for MapType::Queue
and MapType::Stack.
key must have exactly Map::key_size() elements.
Update an element.
key must have exactly Map::key_size() elements. value must have exactly
Map::value_size() elements.
For per-cpu maps, Map::update_percpu() must be used.
Update an element in an per-cpu map with one value per cpu.
key must have exactly Map::key_size() elements. value must have one
element per cpu (see num_possible_cpus()) with exactly Map::value_size()
elements each.
For per-cpu maps, Map::update_percpu() must be used.
