pub struct ErrorStack(/* private fields */);Expand description
A stack of VPP errors
This type represents a stack of VPP errors, similar to Rust’s std::error::Error. It
typically corresponds to a clib_error_t * returned by VPP APIs.
Implementations§
Source§impl ErrorStack
impl ErrorStack
Sourcepub unsafe fn from_raw(ptr: *mut clib_error_t) -> Self
pub unsafe fn from_raw(ptr: *mut clib_error_t) -> Self
Creates an ErrorStack directly from a pointer
§Safety
- The pointer must be valid and point to a VPP vector of type
clib_error_t. - The pointer must stay valid and the contents must not be mutated for the duration of the lifetime of the returned object.
Sourcepub fn into_raw(self) -> *mut clib_error_t
pub fn into_raw(self) -> *mut clib_error_t
Consumes the error stack and returns a raw pointer
After calling this method, the caller is responsible for managing the memory of the vector of errors.
Sourcepub fn new<E: StdError + Send + Sync + 'static>(e: E) -> Self
pub fn new<E: StdError + Send + Sync + 'static>(e: E) -> Self
Creates a new error stack from a standard error
The error message is taken from the Display version of the error.
§Panics
Panics if the error message contains nul characters.
Trait Implementations§
Source§impl Debug for ErrorStack
impl Debug for ErrorStack
Source§impl Display for ErrorStack
impl Display for ErrorStack
Source§impl Drop for ErrorStack
impl Drop for ErrorStack
Source§impl Error for ErrorStack
impl Error for ErrorStack
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Auto Trait Implementations§
impl Freeze for ErrorStack
impl RefUnwindSafe for ErrorStack
impl !Send for ErrorStack
impl !Sync for ErrorStack
impl Unpin for ErrorStack
impl UnsafeUnpin for ErrorStack
impl UnwindSafe for ErrorStack
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more