[][src]Struct fs_err::File

pub struct File { /* fields omitted */ }

A wrapper around a file handle and its path which wraps all operations with more helpful error messages.

Methods

impl File[src]

pub fn open<P>(path: P) -> Result<Self, Error> where
    P: AsRef<Path> + Into<PathBuf>, 
[src]

Wrapper for File::open.

pub fn create<P>(path: P) -> Result<Self, Error> where
    P: AsRef<Path> + Into<PathBuf>, 
[src]

Wrapper for File::create.

pub fn from_options<P>(path: P, options: &OpenOptions) -> Result<Self, Error> where
    P: AsRef<Path> + Into<PathBuf>, 
[src]

Wrapper for OpenOptions::open.

pub fn sync_all(&self) -> Result<(), Error>[src]

Wrapper for File::sync_all.

pub fn sync_data(&self) -> Result<(), Error>[src]

Wrapper for File::sync_data.

pub fn set_len(&self, size: u64) -> Result<(), Error>[src]

Wrapper for File::set_len.

pub fn metadata(&self) -> Result<Metadata, Error>[src]

Wrapper for File::metadata.

pub fn try_clone(&self) -> Result<Self, Error>[src]

Wrapper for File::try_clone.

pub fn set_permissions(&self, perm: Permissions) -> Result<(), Error>[src]

Wrapper for File::set_permissions.

pub fn from_parts<P>(file: File, path: P) -> Self where
    P: Into<PathBuf>, 
[src]

Creates a File from a raw file and its path.

pub fn file(&self) -> &File[src]

Gets the wrapped file.

pub fn path(&self) -> &Path[src]

Gets the path of the wrapped file.

Trait Implementations

impl Debug for File[src]

impl Read for File[src]

impl<'a> Read for &'a File[src]

impl Seek for File[src]

impl<'a> Seek for &'a File[src]

impl Write for File[src]

impl<'a> Write for &'a File[src]

Auto Trait Implementations

impl RefUnwindSafe for File

impl Send for File

impl Sync for File

impl Unpin for File

impl UnwindSafe for File

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.