Ver Fonte

More docs

Alessandro Decina há 3 anos atrás
pai
commit
293e66af65

+ 2 - 2
aya/src/bpf.rs

@@ -297,7 +297,7 @@ impl Bpf {
     ///
     /// Returns [`ProgramError::NotFound`] if the program does not exist.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```no_run
     /// # let bpf = aya::Bpf::load(&[], None)?;
@@ -322,7 +322,7 @@ impl Bpf {
     ///
     /// Returns [`ProgramError::NotFound`] if the program does not exist.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```no_run
     /// # let mut bpf = aya::Bpf::load(&[], None)?;

+ 1 - 1
aya/src/maps/array/array.rs

@@ -17,7 +17,7 @@ use crate::{
 /// The size of the array is defined on the eBPF side using the `bpf_map_def::max_entries` field.
 /// All the entries are zero-initialized when the map is created.
 ///
-/// # Example
+/// # Examples
 /// ```no_run
 /// # let bpf = aya::Bpf::load(&[], None)?;
 /// use aya::maps::Array;

+ 1 - 1
aya/src/maps/array/per_cpu_array.rs

@@ -17,7 +17,7 @@ use crate::{
 /// The size of the array is defined on the eBPF side using the `bpf_map_def::max_entries` field.
 /// All the entries are zero-initialized when the map is created.
 ///
-/// # Example
+/// # Examples
 /// ```no_run
 /// # #[derive(thiserror::Error, Debug)]
 /// # enum Error {

+ 1 - 1
aya/src/maps/array/program_array.rs

@@ -20,7 +20,7 @@ use crate::{
 /// prog_array, index)`. You can use [`ProgramArray`] to configure which
 /// programs correspond to which jump indexes.
 ///
-/// # Example
+/// # Examples
 /// ```no_run
 /// # let bpf = aya::Bpf::load(&[], None)?;
 /// use aya::maps::ProgramArray;

+ 1 - 1
aya/src/maps/hash_map/hash_map.rs

@@ -13,7 +13,7 @@ use crate::{
 
 /// A hash map that can be shared between eBPF programs and user space.
 ///
-/// # Example
+/// # Examples
 ///
 /// ```no_run
 /// # let bpf = aya::Bpf::load(&[], None)?;

+ 2 - 2
aya/src/maps/hash_map/per_cpu_hash_map.rs

@@ -20,7 +20,7 @@ use crate::{
 /// This type can be used with eBPF maps of type `BPF_MAP_TYPE_PERCPU_HASH` and
 /// `BPF_MAP_TYPE_LRU_PERCPU_HASH`.
 ///
-/// # Example
+/// # Examples
 ///
 /// ```no_run
 /// # let bpf = aya::Bpf::load(&[], None)?;
@@ -97,7 +97,7 @@ impl<T: Deref<Target = Map>, K: Pod, V: Pod> PerCpuHashMap<T, K, V> {
 impl<T: DerefMut<Target = Map>, K: Pod, V: Pod> PerCpuHashMap<T, K, V> {
     /// Inserts a slice of values - one for each CPU - for the given key.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```no_run
     /// # #[derive(thiserror::Error, Debug)]

+ 1 - 1
aya/src/maps/mod.rs

@@ -321,7 +321,7 @@ impl PerCpuKernelMem {
 ///
 /// Used by maps that implement per-CPU storage like [`PerCpuHashMap`].
 ///
-/// # Example
+/// # Examples
 ///
 /// ```no_run
 /// # #[derive(thiserror::Error, Debug)]

+ 1 - 1
aya/src/maps/perf/async_perf_event_array.rs

@@ -26,7 +26,7 @@ use crate::maps::{
 /// * call [`AsyncPerfEventArray::open`]
 /// * call [`AsyncPerfEventArrayBuffer::read_events`] to read the events
 ///
-/// # Example
+/// # Examples
 ///
 /// ```no_run
 /// # #[derive(thiserror::Error, Debug)]

+ 1 - 1
aya/src/maps/perf/perf_event_array.rs

@@ -76,7 +76,7 @@ impl<T: DerefMut<Target = Map>> AsRawFd for PerfEventArrayBuffer<T> {
 ///   inserted in the buffer
 /// * call [`PerfEventArrayBuffer::read_events`] to read the events
 ///
-/// # Example
+/// # Examples
 ///
 /// A common way to use a perf array is to have one perf buffer for each
 /// available CPU:

+ 1 - 1
aya/src/maps/queue.rs

@@ -80,7 +80,7 @@ impl<T: Deref<Target = Map> + DerefMut<Target = Map>, V: Pod> Queue<T, V> {
     ///
     /// [`MapError::SyscallError`] if `bpf_map_update_elem` fails.
     ///
-    /// # Example
+    /// # Examples
     /// ```no_run
     /// # let bpf = aya::Bpf::load(&[], None)?;
     /// use aya::maps::Queue;

+ 2 - 2
aya/src/maps/sock/sock_hash.rs

@@ -23,10 +23,10 @@ use crate::{
 /// A `SockHash` can also be used to redirect packets to sockets contained by the
 /// map using `bpf_redirect_map()`, `bpf_sk_redirect_hash()` etc.
 ///
-/// # Example
+/// # Examples
 ///
 /// ```no_run
-/// ##[derive(Debug, thiserror::Error)]
+/// # #[derive(Debug, thiserror::Error)]
 /// # enum Error {
 /// #     #[error(transparent)]
 /// #     IO(#[from] std::io::Error),

+ 1 - 1
aya/src/maps/sock/sock_map.rs

@@ -22,7 +22,7 @@ use crate::{
 /// A `SockMap` can also be used to redirect packets to sockets contained by the
 /// map using `bpf_redirect_map()`, `bpf_sk_redirect_map()` etc.    
 ///
-/// # Example
+/// # Examples
 ///
 /// ```no_run
 /// # let mut bpf = aya::Bpf::load(&[], None)?;

+ 1 - 1
aya/src/maps/stack.rs

@@ -15,7 +15,7 @@ use crate::{
 
 /// A LIFO stack.
 ///
-/// # Example
+/// # Examples
 /// ```no_run
 /// # let bpf = aya::Bpf::load(&[], None)?;
 /// use aya::maps::Stack;

+ 1 - 1
aya/src/maps/stack_trace.rs

@@ -18,7 +18,7 @@ use crate::{
 /// `stack_id = bpf_get_stackid(ctx, map, flags)` from eBPF, and then you can retrieve the traces
 /// from their stack ids.
 ///  
-/// # Example
+/// # Examples
 ///
 /// ```no_run
 /// # #[derive(thiserror::Error, Debug)]

+ 1 - 1
aya/src/obj/btf/btf.rs

@@ -70,7 +70,7 @@ pub enum BtfError {
     MaximumTypeDepthReached { type_id: u32 },
 }
 
-/// Bpf Type Format (BTF) metadata.
+/// Bpf Type Format metadata.
 ///
 /// BTF is a kind of debug metadata that allows eBPF programs compiled against one kernel version
 /// to be loaded into different kernel versions.

+ 1 - 1
aya/src/programs/cgroup_skb.rs

@@ -19,7 +19,7 @@ use super::FdLink;
 ///
 /// [cgroup]: https://man7.org/linux/man-pages/man7/cgroups.7.html
 ///
-/// # Example
+/// # Examples
 ///
 /// ```no_run
 /// # #[derive(thiserror::Error, Debug)]

+ 1 - 1
aya/src/programs/kprobe.rs

@@ -20,7 +20,7 @@ use crate::{
 /// - `kprobe`: get attached to the *start* of the target functions
 /// - `kretprobe`: get attached to the *return address* of the target functions
 ///
-/// # Example
+/// # Examples
 ///
 /// ```no_run
 /// # let mut bpf = Bpf::load_file("ebpf_programs.o")?;

+ 2 - 2
aya/src/programs/sk_msg.rs

@@ -11,10 +11,10 @@ use crate::{
 /// filter and redirect messages sent on sockets. See also [`SockMap`] and
 /// [`SockHash`].
 ///
-/// # Example
+/// # Examples
 ///
 /// ```no_run
-/// ##[derive(Debug, thiserror::Error)]
+/// # #[derive(Debug, thiserror::Error)]
 /// # enum Error {
 /// #     #[error(transparent)]
 /// #     IO(#[from] std::io::Error),

+ 1 - 1
aya/src/programs/sk_skb.rs

@@ -21,7 +21,7 @@ pub enum SkSkbKind {
 /// inspect, redirect or filter incoming packet. See also [`SockMap`] and
 /// [`SockHash`].
 ///
-/// # Example
+/// # Examples
 ///
 /// ```no_run
 /// # let mut bpf = aya::Bpf::load(&[], None)?;

+ 1 - 1
aya/src/programs/sock_ops.rs

@@ -12,7 +12,7 @@ use crate::{
 /// parameters, watch connection state changes and more. They are attached to
 /// cgroups.
 ///
-/// # Example
+/// # Examples
 ///
 /// ```no_run
 /// # #[derive(thiserror::Error, Debug)]

+ 2 - 2
aya/src/programs/socket_filter.rs

@@ -27,10 +27,10 @@ pub enum SocketFilterError {
 /// and filter incoming packets.
 ///
 ///
-/// # Example
+/// # Examples
 ///
 /// ```no_run
-/// ##[derive(Debug, thiserror::Error)]
+/// # #[derive(Debug, thiserror::Error)]
 /// # enum Error {
 /// #     #[error(transparent)]
 /// #     IO(#[from] std::io::Error),

+ 2 - 2
aya/src/programs/tc.rs

@@ -30,10 +30,10 @@ pub enum TcAttachType {
 /// linux network traffic control system. See
 /// [https://man7.org/linux/man-pages/man8/tc-bpf.8.html](https://man7.org/linux/man-pages/man8/tc-bpf.8.html).
 ///
-/// # Example
+/// # Examples
 ///
 /// ```no_run
-/// ##[derive(Debug, thiserror::Error)]
+/// # #[derive(Debug, thiserror::Error)]
 /// # enum Error {
 /// #     #[error(transparent)]
 /// #     IO(#[from] std::io::Error),

+ 2 - 2
aya/src/programs/trace_point.rs

@@ -22,10 +22,10 @@ pub enum TracePointError {
 /// be attached to. See `/sys/kernel/debug/tracing/events` for a list of which
 /// events can be traced.
 ///
-/// # Example
+/// # Examples
 ///
 /// ```no_run
-/// ##[derive(Debug, thiserror::Error)]
+/// # #[derive(Debug, thiserror::Error)]
 /// # enum Error {
 /// #     #[error(transparent)]
 /// #     IO(#[from] std::io::Error),

+ 1 - 1
aya/src/programs/xdp.rs

@@ -46,7 +46,7 @@ bitflags! {
 /// underlying network driver, XDP programs can execute directly on network cards, greatly
 /// reducing CPU load.
 ///
-/// # Example
+/// # Examples
 ///
 /// ```no_run
 /// # let mut bpf = Bpf::load_file("ebpf_programs.o")?;