Enum procfs::ProcError

source ·
pub enum ProcError {
    PermissionDenied(Option<PathBuf>),
    NotFound(Option<PathBuf>),
    Incomplete(Option<PathBuf>),
    Io(Error, Option<PathBuf>),
    Other(String),
    InternalError(InternalError),
}
Expand description

The various error conditions in the procfs crate.

Most of the variants have an Option<PathBuf> component. If the error root cause was related to some operation on a file, the path of this file will be stored in this component.

Variants§

§

PermissionDenied(Option<PathBuf>)

A standard permission denied error.

This will be a common error, since some files in the procfs filesystem are only readable by the root user.

§

NotFound(Option<PathBuf>)

This might mean that the process no longer exists, or that your kernel doesn’t support the feature you are trying to use.

§

Incomplete(Option<PathBuf>)

This might mean that a procfs file has incomplete contents.

If you encounter this error, consider retrying the operation.

§

Io(Error, Option<PathBuf>)

Any other IO error (rare).

§

Other(String)

Any other non-IO error (very rare).

§

InternalError(InternalError)

This error indicates that some unexpected error occurred. This is a bug. The inner InternalError struct will contain some more info.

If you ever encounter this error, consider it a bug in the procfs crate and please report it on github.

Trait Implementations§

source§

impl Debug for ProcError

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl Display for ProcError

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl Error for ProcError

1.30.0 · source§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more
source§

impl From<&'static str> for ProcError

source§

fn from(val: &'static str) -> ProcError

Converts to this type from the input type.
source§

impl From<Error> for ProcError

source§

fn from(io: Error) -> ProcError

Converts to this type from the input type.
source§

impl From<Infallible> for ProcError

source§

fn from(e: Infallible) -> ProcError

Converts to this type from the input type.
source§

impl From<ParseIntError> for ProcError

source§

fn from(val: ParseIntError) -> ProcError

Converts to this type from the input type.
source§

impl ProcErrorExt for ProcError

source§

fn error_path(self, path: &Path) -> ProcError

Add path information to the error.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToString for Twhere T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.