Enum reth_fs_util::FsPathError

source ·
pub enum FsPathError {
Show 13 variants Write { source: Error, path: PathBuf, }, Read { source: Error, path: PathBuf, }, ReadLink { source: Error, path: PathBuf, }, CreateFile { source: Error, path: PathBuf, }, RemoveFile { source: Error, path: PathBuf, }, CreateDir { source: Error, path: PathBuf, }, RemoveDir { source: Error, path: PathBuf, }, ReadDir { source: Error, path: PathBuf, }, Rename { source: Error, from: PathBuf, to: PathBuf, }, Open { source: Error, path: PathBuf, }, ReadJson { source: Error, path: PathBuf, }, WriteJson { source: Error, path: PathBuf, }, Metadata { source: Error, path: PathBuf, },
}
Expand description

Various error variants for std::fs operations that serve as an addition to the io::Error which does not provide any information about the path.

Variants§

§

Write

Error variant for failed write operation with additional path context.

Fields

§source: Error

The source io::Error.

§path: PathBuf

The path related to the operation.

§

Read

Error variant for failed read operation with additional path context.

Fields

§source: Error

The source io::Error.

§path: PathBuf

The path related to the operation.

Error variant for failed read link operation with additional path context.

Fields

§source: Error

The source io::Error.

§path: PathBuf

The path related to the operation.

§

CreateFile

Error variant for failed file creation operation with additional path context.

Fields

§source: Error

The source io::Error.

§path: PathBuf

The path related to the operation.

§

RemoveFile

Error variant for failed file removal operation with additional path context.

Fields

§source: Error

The source io::Error.

§path: PathBuf

The path related to the operation.

§

CreateDir

Error variant for failed directory creation operation with additional path context.

Fields

§source: Error

The source io::Error.

§path: PathBuf

The path related to the operation.

§

RemoveDir

Error variant for failed directory removal operation with additional path context.

Fields

§source: Error

The source io::Error.

§path: PathBuf

The path related to the operation.

§

ReadDir

Error variant for failed directory read operation with additional path context.

Fields

§source: Error

The source io::Error.

§path: PathBuf

The path related to the operation.

§

Rename

Error variant for failed file renaming operation with additional path context.

Fields

§source: Error

The source io::Error.

§from: PathBuf

The original path.

§to: PathBuf

The target path.

§

Open

Error variant for failed file opening operation with additional path context.

Fields

§source: Error

The source io::Error.

§path: PathBuf

The path related to the operation.

§

ReadJson

Error variant for failed file read as JSON operation with additional path context.

Fields

§source: Error

The source serde_json::Error.

§path: PathBuf

The path related to the operation.

§

WriteJson

Error variant for failed JSON write to file operation with additional path context.

Fields

§source: Error

The source serde_json::Error.

§path: PathBuf

The path related to the operation.

§

Metadata

Error variant for failed file metadata operation with additional path context.

Fields

§source: Error

The source io::Error.

§path: PathBuf

The path related to the operation.

Implementations§

source§

impl FsPathError

source

pub fn write(source: Error, path: impl Into<PathBuf>) -> Self

Returns the complementary error variant for std::fs::write.

source

pub fn read(source: Error, path: impl Into<PathBuf>) -> Self

Returns the complementary error variant for std::fs::read.

Returns the complementary error variant for std::fs::read_link.

source

pub fn create_file(source: Error, path: impl Into<PathBuf>) -> Self

Returns the complementary error variant for std::fs::File::create.

source

pub fn remove_file(source: Error, path: impl Into<PathBuf>) -> Self

Returns the complementary error variant for std::fs::remove_file.

source

pub fn create_dir(source: Error, path: impl Into<PathBuf>) -> Self

Returns the complementary error variant for std::fs::create_dir.

source

pub fn remove_dir(source: Error, path: impl Into<PathBuf>) -> Self

Returns the complementary error variant for std::fs::remove_dir.

source

pub fn read_dir(source: Error, path: impl Into<PathBuf>) -> Self

Returns the complementary error variant for std::fs::read_dir.

source

pub fn open(source: Error, path: impl Into<PathBuf>) -> Self

Returns the complementary error variant for std::fs::File::open.

source

pub fn rename( source: Error, from: impl Into<PathBuf>, to: impl Into<PathBuf>, ) -> Self

Returns the complementary error variant for std::fs::rename.

source

pub fn metadata(source: Error, path: impl Into<PathBuf>) -> Self

Returns the complementary error variant for std::fs::File::metadata.

Trait Implementations§

source§

impl Debug for FsPathError

source§

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

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

impl Display for FsPathError

source§

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

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

impl Error for FsPathError

source§

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

👎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 #99301)
Provides type-based access to context intended for error reports. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where 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 T
where 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 T
where 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 T
where U: Into<T>,

source§

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 T
where U: TryFrom<T>,

source§

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.

Layout§

Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.

Size: 64 bytes

Size for each variant:

  • Write: 32 bytes
  • Read: 32 bytes
  • ReadLink: 32 bytes
  • CreateFile: 32 bytes
  • RemoveFile: 32 bytes
  • CreateDir: 32 bytes
  • RemoveDir: 32 bytes
  • ReadDir: 32 bytes
  • Rename: 56 bytes
  • Open: 32 bytes
  • ReadJson: 32 bytes
  • WriteJson: 32 bytes
  • Metadata: 32 bytes