aya: tweak docs

pull/1/head
Alessandro Decina 4 years ago
parent 5aa9cb12ad
commit eea27f52f3

@ -3,17 +3,17 @@
//! The eBPF platform provides data structures - maps in eBPF speak - that can be used by eBPF
//! programs and user-space to exchange data.
//!
//! When you call [Bpf::load_file](crate::Bpf::load_file) or [Bpf::load](crate::Bpf::load), aya
//! When you call [`Bpf::load_file`](crate::Bpf::load_file) or [`Bpf::load`](crate::Bpf::load), aya
//! transparently discovers all the maps defined in the loaded code and initializes them. The maps
//! can then be accessed using [Bpf::map](crate::Bpf::map) and [Bpf::map_mut](crate::Bpf::map_mut).
//! can then be accessed using [`Bpf::map`](crate::Bpf::map) and [`Bpf::map_mut`](crate::Bpf::map_mut).
//!
//! # Concrete map types
//!
//! Different map types support different operations. [Bpf::map](crate::Bpf::map) and
//! [Bpf::map_mut](crate::Bpf::map_mut) always return the opaque [MapRef] and [MapRefMut] types
//! respectively, which you can convert those to concrete map types using the
//! [TryFrom](std::convert::TryFrom) trait. For example to insert a value inside a
//! [HashMap](crate::maps::hash_map::HashMap):
//! Different map types support different operations. [`Bpf::map`](crate::Bpf::map) and
//! [`Bpf::map_mut`](crate::Bpf::map_mut) always return the opaque [`MapRef`] and [`MapRefMut`]
//! types respectively, which you can convert to concrete map types using the
//! [`TryFrom`](std::convert::TryFrom) trait. For example the code below shows how to insert a
//! value inside a [`HashMap`](crate::maps::hash_map::HashMap):
//!
//! ```no_run
//! # let bpf = aya::Bpf::load(&[], None)?;
@ -27,7 +27,7 @@
//! # Ok::<(), aya::BpfError>(())
//! ```
//!
//! All the concrete map types implement the [TryFrom](std::convert::TryFrom) trait.
//! All the concrete map types implement the [`TryFrom`](std::convert::TryFrom) trait.
use std::{convert::TryFrom, ffi::CString, io, os::unix::io::RawFd};
use thiserror::Error;

@ -22,7 +22,7 @@ use crate::{
/// Perf buffer error.
#[derive(Error, Debug)]
pub enum PerfBufferError {
/// the page count value passed to [`PerfEventArray::open`] is invalid.
/// the page count value passed to [`PerfEventArray::open`](crate::maps::PerfEventArray::open) is invalid.
#[error("invalid page count {page_count}, the value must be a power of two")]
InvalidPageCount { page_count: usize },

Loading…
Cancel
Save