[][src]Struct fs_err::File

pub struct File { /* fields omitted */ }

Wrapper around std::fs::File which adds more helpful information to all errors.

Implementations

impl File[src]

Wrappers for methods from std::fs::File.

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]

👎 Deprecated:

use fs_err::OpenOptions::open instead

Wrapper for OpenOptions::open.

This takes &std::fs::OpenOptions, not [fs_err::OpenOptions].

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.

impl File[src]

Methods added by fs-err that are not available on std::fs::File.

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

Returns a reference to the underlying std::fs::File.

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

Returns a reference to the path that this file was created with.

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.