Skip to main content

SysWithPathsInErrors

Struct SysWithPathsInErrors 

Source
pub struct SysWithPathsInErrors<T>(pub 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: T

Implementations§

Source§

impl<T> SysWithPathsInErrors<T>

Source

pub fn new(inner: T) -> Self

Creates a new SysWithPathsInErrors wrapper.

Source

pub fn inner(&self) -> &T

Returns a reference to the inner value.

Source

pub fn into_inner(self) -> T

Consumes the wrapper and returns 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§

impl<T: BaseFsOpen> SysWithPathsInErrors<&T>

Source

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

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: Clone> Clone for SysWithPathsInErrors<T>

Source§

fn clone(&self) -> SysWithPathsInErrors<T>

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl<T: Debug> Debug for SysWithPathsInErrors<T>

Source§

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

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

impl<T: Copy> Copy for SysWithPathsInErrors<T>

Auto Trait Implementations§

§

impl<T> Freeze for SysWithPathsInErrors<T>
where T: Freeze,

§

impl<T> RefUnwindSafe for SysWithPathsInErrors<T>
where T: RefUnwindSafe,

§

impl<T> Send for SysWithPathsInErrors<T>
where T: Send,

§

impl<T> Sync for SysWithPathsInErrors<T>
where T: Sync,

§

impl<T> Unpin for SysWithPathsInErrors<T>
where T: Unpin,

§

impl<T> UnwindSafe for SysWithPathsInErrors<T>
where T: UnwindSafe,

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

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.