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

Returns a file descriptor to the underlying map.

Key size in bytes

Value size in bytes

Pin this map to bpffs.

Unpin from bpffs

Returns map value as Vec of u8.

key must have exactly Map::key_size() elements.

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 exatly Map::value_size() elements.

Returns an iterator over keys in this map

Note that if the map is not stable (stable meaning no updates or deletes) during iteration, iteration can skip keys, restart from the beginning, or duplicate keys. In other words, iteration becomes unpredictable.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.