Skip to main content

SysWithPathsInErrors

Struct SysWithPathsInErrors 

Source
pub struct SysWithPathsInErrors<'a, T: ?Sized>(pub &'a T);
Expand description

A wrapper that adds error context to sys_traits operations.

Use PathsInErrorsExt::with_paths_in_errors to create an instance.

Tuple Fields§

§0: &'a T

Implementations§

Source§

impl<'a, T: ?Sized> SysWithPathsInErrors<'a, T>

Source

pub fn new(inner: &'a T) -> Self

Creates a new SysWithPathsInErrors wrapper.

Source

pub fn as_ref(&self) -> &T

Returns a reference to the inner value.

Source§

impl<T: BaseFsCanonicalize> SysWithPathsInErrors<'_, T>

Source

pub fn fs_canonicalize(&self, path: impl AsRef<Path>) -> Result<PathBuf>

Source§

impl<T: BaseFsChown> SysWithPathsInErrors<'_, T>

Source

pub fn fs_chown( &self, path: impl AsRef<Path>, uid: Option<u32>, gid: Option<u32>, ) -> Result<()>

Source§

impl<T: BaseFsSymlinkChown> SysWithPathsInErrors<'_, T>

Source§

impl<T: BaseFsCloneFile> SysWithPathsInErrors<'_, T>

Source

pub fn fs_clone_file( &self, from: impl AsRef<Path>, to: impl AsRef<Path>, ) -> Result<()>

Source§

impl<T: BaseFsCopy> SysWithPathsInErrors<'_, T>

Source

pub fn fs_copy( &self, from: impl AsRef<Path>, to: impl AsRef<Path>, ) -> Result<u64>

Source§

impl<T: BaseFsCreateDir> SysWithPathsInErrors<'_, T>

Source

pub fn fs_create_dir( &self, path: impl AsRef<Path>, options: &CreateDirOptions, ) -> Result<()>

Source

pub fn fs_create_dir_all(&self, path: impl AsRef<Path>) -> Result<()>

Source§

impl<T: BaseFsHardLink> SysWithPathsInErrors<'_, T>

Source§

impl<T: BaseFsCreateJunction> SysWithPathsInErrors<'_, T>

Source

pub fn fs_create_junction( &self, original: impl AsRef<Path>, junction: impl AsRef<Path>, ) -> Result<()>

Source§

impl<T: BaseFsMetadata> SysWithPathsInErrors<'_, T>

Source

pub fn fs_metadata(&self, path: impl AsRef<Path>) -> Result<T::Metadata>

Source

pub fn fs_is_file(&self, path: impl AsRef<Path>) -> Result<bool>

Source

pub fn fs_is_dir(&self, path: impl AsRef<Path>) -> Result<bool>

Source

pub fn fs_exists(&self, path: impl AsRef<Path>) -> Result<bool>

Source

pub fn fs_exists_no_err(&self, path: impl AsRef<Path>) -> bool

Source

pub fn fs_is_file_no_err(&self, path: impl AsRef<Path>) -> bool

Source

pub fn fs_is_dir_no_err(&self, path: impl AsRef<Path>) -> bool

Source§

impl<T: BaseFsOpen> SysWithPathsInErrors<'_, T>

Source

pub fn fs_open( &self, path: impl AsRef<Path>, options: &OpenOptions, ) -> Result<FsFileWithPathsInErrors<T::File>>

Source§

impl<T: FsOpenBoxed + ?Sized> SysWithPathsInErrors<'_, T>

Source§

impl<T: BaseFsRead> SysWithPathsInErrors<'_, T>

Source

pub fn fs_read(&self, path: impl AsRef<Path>) -> Result<Cow<'static, [u8]>>

Source

pub fn fs_read_to_string( &self, path: impl AsRef<Path>, ) -> Result<Cow<'static, str>>

Source

pub fn fs_read_to_string_lossy( &self, path: impl AsRef<Path>, ) -> Result<Cow<'static, str>>

Source§

impl<T: BaseFsReadDir> SysWithPathsInErrors<'_, T>

Source

pub fn fs_read_dir( &self, path: impl AsRef<Path>, ) -> Result<Box<dyn Iterator<Item = Result<T::ReadDirEntry>>>>

Source§

impl<T: BaseFsReadLink> SysWithPathsInErrors<'_, T>

Source§

impl<T: BaseFsRemoveDir> SysWithPathsInErrors<'_, T>

Source

pub fn fs_remove_dir(&self, path: impl AsRef<Path>) -> Result<()>

Source§

impl<T: BaseFsRemoveDirAll> SysWithPathsInErrors<'_, T>

Source

pub fn fs_remove_dir_all(&self, path: impl AsRef<Path>) -> Result<()>

Source§

impl<T: BaseFsRemoveFile> SysWithPathsInErrors<'_, T>

Source

pub fn fs_remove_file(&self, path: impl AsRef<Path>) -> Result<()>

Source§

impl<T: BaseFsRename> SysWithPathsInErrors<'_, T>

Source

pub fn fs_rename( &self, from: impl AsRef<Path>, to: impl AsRef<Path>, ) -> Result<()>

Source§

impl<T: BaseFsSetFileTimes> SysWithPathsInErrors<'_, T>

Source

pub fn fs_set_file_times( &self, path: impl AsRef<Path>, atime: SystemTime, mtime: SystemTime, ) -> Result<()>

Source§

impl<T: BaseFsSetSymlinkFileTimes> SysWithPathsInErrors<'_, T>

Source§

impl<T: BaseFsSetPermissions> SysWithPathsInErrors<'_, T>

Source

pub fn fs_set_permissions( &self, path: impl AsRef<Path>, mode: u32, ) -> Result<()>

Source§

impl<T: BaseFsSymlinkDir> SysWithPathsInErrors<'_, T>

Source§

impl<T: BaseFsSymlinkFile> SysWithPathsInErrors<'_, T>

Source§

impl<T: BaseFsWrite> SysWithPathsInErrors<'_, T>

Source

pub fn fs_write( &self, path: impl AsRef<Path>, data: impl AsRef<[u8]>, ) -> Result<()>

Trait Implementations§

Source§

impl<T: ?Sized> Clone for SysWithPathsInErrors<'_, T>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'a, T: Debug + ?Sized> Debug for SysWithPathsInErrors<'a, T>

Source§

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

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

impl<T: ?Sized> Copy for SysWithPathsInErrors<'_, T>

Auto Trait Implementations§

§

impl<'a, T> Freeze for SysWithPathsInErrors<'a, T>
where T: ?Sized,

§

impl<'a, T> RefUnwindSafe for SysWithPathsInErrors<'a, T>
where T: RefUnwindSafe + ?Sized,

§

impl<'a, T> Send for SysWithPathsInErrors<'a, T>
where T: Sync + ?Sized,

§

impl<'a, T> Sync for SysWithPathsInErrors<'a, T>
where T: Sync + ?Sized,

§

impl<'a, T> Unpin for SysWithPathsInErrors<'a, T>
where T: ?Sized,

§

impl<'a, T> UnsafeUnpin for SysWithPathsInErrors<'a, T>
where T: ?Sized,

§

impl<'a, T> UnwindSafe for SysWithPathsInErrors<'a, T>
where T: RefUnwindSafe + ?Sized,

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> PathsInErrorsExt for T
where T: ?Sized,

Source§

fn with_paths_in_errors(&self) -> SysWithPathsInErrors<'_, Self>

Wraps self in a SysWithPathsInErrors that includes paths in error messages.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. 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.