Skip to content

Commit

Permalink
Improve the documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
lu-zero committed Nov 14, 2023
1 parent 9283dac commit 68f5241
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
//! [netlink](https://www.man7.org/linux/man-pages/man7/netlink.7.html) `NETLINK_KOBJECT_UEVENT` packet parser
//!
//! The [uevents](https://www.kernel.org/doc/html/latest/core-api/kobject.html#uevents) are
//! triggered by `kobject_uevent` and `kobject_uevent_env` to signal a change in the referred kobject.

use anyhow::anyhow;
use std::collections::HashMap;
use std::path::Path;
Expand All @@ -9,13 +14,25 @@ use std::{path::PathBuf, str::from_utf8};
///
/// See kobject_action in include/linux/kobject.h
pub enum ActionType {
/// A new kobject is added
Add,
/// A kobject is removed
Remove,
/// the kobject changed its internal state
///
/// the `env` contains kobject-specific information.
Change,
/// the kobject is reparented as a result of `kobject_move`
///
/// the `env` contains `DEVPATH_OLD=<oldpath>`.
Move,
/// The device is back online after successful `device_offline`.
Online,
/// The device is ready to be hot-removed.
Offline,
/// The device is bound to a driver.
Bind,
/// The device is not bound to its driver anymore.
Unbind,
}

Expand Down

0 comments on commit 68f5241

Please sign in to comment.