[−][src]Struct fs_err::File
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]
P: AsRef<Path> + Into<PathBuf>,
Wrapper for File::open.
pub fn create<P>(path: P) -> Result<Self, Error> where
P: AsRef<Path> + Into<PathBuf>, [src]
P: AsRef<Path> + Into<PathBuf>,
Wrapper for File::create.
pub fn from_options<P>(path: P, options: &OpenOptions) -> Result<Self, Error> where
P: AsRef<Path> + Into<PathBuf>, [src]
P: AsRef<Path> + Into<PathBuf>,
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]
P: Into<PathBuf>,
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]
fn read(&mut self, buf: &mut [u8]) -> Result<usize>[src]
fn read_vectored(&mut self, bufs: &mut [IoSliceMut]) -> Result<usize>[src]
unsafe fn initializer(&self) -> Initializer[src]
fn read_to_end(&mut self, buf: &mut Vec<u8>) -> Result<usize, Error>1.0.0[src]
fn read_to_string(&mut self, buf: &mut String) -> Result<usize, Error>1.0.0[src]
fn read_exact(&mut self, buf: &mut [u8]) -> Result<(), Error>1.6.0[src]
fn by_ref(&mut self) -> &mut Self1.0.0[src]
fn bytes(self) -> Bytes<Self>1.0.0[src]
fn chain<R>(self, next: R) -> Chain<Self, R> where
R: Read, 1.0.0[src]
R: Read,
fn take(self, limit: u64) -> Take<Self>1.0.0[src]
impl<'a> Read for &'a File[src]
fn read(&mut self, buf: &mut [u8]) -> Result<usize>[src]
fn read_vectored(&mut self, bufs: &mut [IoSliceMut]) -> Result<usize>[src]
unsafe fn initializer(&self) -> Initializer[src]
fn read_to_end(&mut self, buf: &mut Vec<u8>) -> Result<usize, Error>1.0.0[src]
fn read_to_string(&mut self, buf: &mut String) -> Result<usize, Error>1.0.0[src]
fn read_exact(&mut self, buf: &mut [u8]) -> Result<(), Error>1.6.0[src]
fn by_ref(&mut self) -> &mut Self1.0.0[src]
fn bytes(self) -> Bytes<Self>1.0.0[src]
fn chain<R>(self, next: R) -> Chain<Self, R> where
R: Read, 1.0.0[src]
R: Read,
fn take(self, limit: u64) -> Take<Self>1.0.0[src]
impl Seek for File[src]
fn seek(&mut self, pos: SeekFrom) -> Result<u64>[src]
fn stream_len(&mut self) -> Result<u64, Error>[src]
fn stream_position(&mut self) -> Result<u64, Error>[src]
impl<'a> Seek for &'a File[src]
fn seek(&mut self, pos: SeekFrom) -> Result<u64>[src]
fn stream_len(&mut self) -> Result<u64, Error>[src]
fn stream_position(&mut self) -> Result<u64, Error>[src]
impl Write for File[src]
fn write(&mut self, buf: &[u8]) -> Result<usize>[src]
fn write_vectored(&mut self, bufs: &[IoSlice]) -> Result<usize>[src]
fn flush(&mut self) -> Result<()>[src]
fn write_all(&mut self, buf: &[u8]) -> Result<(), Error>1.0.0[src]
fn write_fmt(&mut self, fmt: Arguments) -> Result<(), Error>1.0.0[src]
fn by_ref(&mut self) -> &mut Self1.0.0[src]
impl<'a> Write for &'a File[src]
fn write(&mut self, buf: &[u8]) -> Result<usize>[src]
fn write_vectored(&mut self, bufs: &[IoSlice]) -> Result<usize>[src]
fn flush(&mut self) -> Result<()>[src]
fn write_all(&mut self, buf: &[u8]) -> Result<(), Error>1.0.0[src]
fn write_fmt(&mut self, fmt: Arguments) -> Result<(), Error>1.0.0[src]
fn by_ref(&mut self) -> &mut Self1.0.0[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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,