Skip to main content

libcontainer/network/
mod.rs

1pub mod address;
2pub mod cidr;
3mod client;
4mod fake;
5pub mod link;
6pub mod network_device;
7mod traits;
8pub mod wrapper;
9
10#[derive(Debug, thiserror::Error)]
11pub enum NetworkError {
12    #[error(transparent)]
13    Nix(#[from] nix::Error),
14    #[error(transparent)]
15    IO(#[from] std::io::Error),
16    #[error("failed to initialize NetlinkClient")]
17    ClientInitializeError,
18}
19
20type Result<T> = std::result::Result<T, NetworkError>;
21
22/// Represents a response from a Netlink operation.
23///
24/// This enum encapsulates the possible outcomes of a Netlink operation:
25/// - Success: The operation completed successfully with a response of type T
26/// - Error: The operation failed with an error code
27/// - Done: The operation completed with no more data to process
28#[derive(Debug)]
29pub enum NetlinkResponse<T> {
30    Success(T),
31    Error(i32),
32    Done,
33    None,
34}