Skip to main content

dpdk_stdlib/
error.rs

1use thiserror::Error;
2
3#[derive(Error, Debug)]
4pub enum DpdkError {
5    #[error("EAL initialization failed: {0}")]
6    EalInitFailed(i32),
7    #[error("Port configuration failed: {0}")]
8    PortConfigFailed(i32),
9    #[error("Invalid port ID: {0}")]
10    InvalidPortId(u16),
11    #[error("Memory allocation failed")]
12    MemoryAllocationFailed,
13    #[error("Mempool creation failed: {0}")]
14    MempoolCreateFailed(String),
15    #[error("Queue setup failed: {0}")]
16    QueueSetupFailed(i32),
17    #[error("Invalid name: {0}")]
18    InvalidName(String),
19}
20
21pub type DpdkResult<T> = Result<T, DpdkError>;