aya: tweak PerfEventArray docs

pull/1/head
Alessandro Decina 3 years ago
parent 6772595f3e
commit 6ecf7dabf3

@ -22,10 +22,10 @@ use crate::{
/// use aya::maps::HashMap;
/// use std::convert::TryFrom;
///
/// const CONFIG_KEY_NUM_RETRIES: u8 = 1;
/// let mut redirect_ports = HashMap::try_from(bpf.map_mut("REDIRECT_PORTS")?)?;
///
/// let mut hm = HashMap::try_from(bpf.map_mut("CONFIG")?)?;
/// hm.insert(CONFIG_KEY_NUM_RETRIES, 3, 0 /* flags */);
/// redirect_ports.insert(80, 8080, 0 /* flags */);
/// redirect_ports.insert(443, 8443, 0 /* flags */);
/// # Ok::<(), aya::BpfError>(())
/// ```
#[doc(alias = "BPF_MAP_TYPE_HASH")]

@ -137,7 +137,7 @@ impl<T: DerefMut<Target = Map>> AsRawFd for PerfEventArrayBuffer<T> {
///
/// # Polling and avoiding lost events
///
/// In the example above the implementation of `poll_buffers` and `poll.poll_readable()` is not
/// In the example above the implementation of `poll_buffers()` and `poll.poll_readable()` is not
/// given. [`PerfEventArrayBuffer`] implements the [`AsRawFd`] trait, so you can implement polling
/// using any crate that can poll file descriptors, like [epoll], [mio] etc.
///

Loading…
Cancel
Save