reth_fs_util

Enum FsPathError

Source
pub enum FsPathError {
Show 14 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, }, Fsync { 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.

§

Fsync

Error variant for failed fsync 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.

Source

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

Returns the complementary error variant for fsync.

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§

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: 56 bytes

Size for each variant:

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