Struct fs_err::File [−][src]
pub struct File { /* fields omitted */ }
Wrapper around std::fs::File
which adds more helpful
information to all errors.
Implementations
impl File
[src]
impl File
[src]Wrappers for methods from std::fs::File
.
pub fn create<P>(path: P) -> Result<Self, Error> where
P: Into<PathBuf>,
[src]
pub fn create<P>(path: P) -> Result<Self, Error> where
P: Into<PathBuf>,
[src]Wrapper for File::create
.
pub fn from_options<P>(path: P, options: &OpenOptions) -> Result<Self, Error> where
P: Into<PathBuf>,
[src]
👎 Deprecated: use fs_err::OpenOptions::open instead
pub fn from_options<P>(path: P, options: &OpenOptions) -> Result<Self, Error> where
P: Into<PathBuf>,
[src]use fs_err::OpenOptions::open instead
Wrapper for OpenOptions::open
.
This takes &std::fs::OpenOptions
,
not crate::OpenOptions
.
pub fn try_clone(&self) -> Result<Self, Error>
[src]
pub fn try_clone(&self) -> Result<Self, Error>
[src]Wrapper for File::try_clone
.
pub fn set_permissions(&self, perm: Permissions) -> Result<(), Error>
[src]
pub fn set_permissions(&self, perm: Permissions) -> Result<(), Error>
[src]Wrapper for File::set_permissions
.
impl File
[src]
impl File
[src]Methods added by fs-err that are not available on
std::fs::File
.
pub fn from_parts<P>(file: File, path: P) -> Self where
P: Into<PathBuf>,
[src]
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]
pub fn file(&self) -> &File
[src]Returns a reference to the underlying std::fs::File
.
pub fn file_mut(&mut self) -> &mut File
[src]
pub fn file_mut(&mut self) -> &mut File
[src]Returns a mutable reference to the underlying std::fs::File
.
Trait Implementations
impl AsRawHandle for File
[src]
impl AsRawHandle for File
[src]fn as_raw_handle(&self) -> RawHandle
[src]
fn as_raw_handle(&self) -> RawHandle
[src]Extracts the raw handle, without taking any ownership.
impl IntoRawHandle for File
[src]
impl IntoRawHandle for File
[src]fn into_raw_handle(self) -> RawHandle
[src]
fn into_raw_handle(self) -> RawHandle
[src]Consumes this object, returning the raw underlying handle. Read more
impl Read for File
[src]
impl Read for File
[src]fn read(&mut self, buf: &mut [u8]) -> Result<usize>
[src]
fn read(&mut self, buf: &mut [u8]) -> Result<usize>
[src]Pull some bytes from this source into the specified buffer, returning how many bytes were read. Read more
fn read_vectored(&mut self, bufs: &mut [IoSliceMut<'_>]) -> Result<usize>
[src]
fn read_vectored(&mut self, bufs: &mut [IoSliceMut<'_>]) -> Result<usize>
[src]Like read
, except that it reads into a slice of buffers. Read more
fn is_read_vectored(&self) -> bool
[src]
fn is_read_vectored(&self) -> bool
[src]can_vector
)Determines if this Read
er has an efficient read_vectored
implementation. Read more
unsafe fn initializer(&self) -> Initializer
[src]
unsafe fn initializer(&self) -> Initializer
[src]read_initializer
)Determines if this Read
er can work with buffers of uninitialized
memory. Read more
fn read_to_end(&mut self, buf: &mut Vec<u8, Global>) -> Result<usize, Error>
1.0.0[src]
fn read_to_end(&mut self, buf: &mut Vec<u8, Global>) -> Result<usize, Error>
1.0.0[src]Read all bytes until EOF in this source, placing them into buf
. Read more
fn read_to_string(&mut self, buf: &mut String) -> Result<usize, Error>
1.0.0[src]
fn read_to_string(&mut self, buf: &mut String) -> Result<usize, Error>
1.0.0[src]Read all bytes until EOF in this source, appending them to buf
. Read more
fn read_exact(&mut self, buf: &mut [u8]) -> Result<(), Error>
1.6.0[src]
fn read_exact(&mut self, buf: &mut [u8]) -> Result<(), Error>
1.6.0[src]Read the exact number of bytes required to fill buf
. Read more
fn by_ref(&mut self) -> &mut Self
1.0.0[src]
fn by_ref(&mut self) -> &mut Self
1.0.0[src]Creates a “by reference” adaptor for this instance of Read
. Read more
impl<'a> Read for &'a File
[src]
impl<'a> Read for &'a File
[src]fn read(&mut self, buf: &mut [u8]) -> Result<usize>
[src]
fn read(&mut self, buf: &mut [u8]) -> Result<usize>
[src]Pull some bytes from this source into the specified buffer, returning how many bytes were read. Read more
fn read_vectored(&mut self, bufs: &mut [IoSliceMut<'_>]) -> Result<usize>
[src]
fn read_vectored(&mut self, bufs: &mut [IoSliceMut<'_>]) -> Result<usize>
[src]Like read
, except that it reads into a slice of buffers. Read more
fn is_read_vectored(&self) -> bool
[src]
fn is_read_vectored(&self) -> bool
[src]can_vector
)Determines if this Read
er has an efficient read_vectored
implementation. Read more
unsafe fn initializer(&self) -> Initializer
[src]
unsafe fn initializer(&self) -> Initializer
[src]read_initializer
)Determines if this Read
er can work with buffers of uninitialized
memory. Read more
fn read_to_end(&mut self, buf: &mut Vec<u8, Global>) -> Result<usize, Error>
1.0.0[src]
fn read_to_end(&mut self, buf: &mut Vec<u8, Global>) -> Result<usize, Error>
1.0.0[src]Read all bytes until EOF in this source, placing them into buf
. Read more
fn read_to_string(&mut self, buf: &mut String) -> Result<usize, Error>
1.0.0[src]
fn read_to_string(&mut self, buf: &mut String) -> Result<usize, Error>
1.0.0[src]Read all bytes until EOF in this source, appending them to buf
. Read more
fn read_exact(&mut self, buf: &mut [u8]) -> Result<(), Error>
1.6.0[src]
fn read_exact(&mut self, buf: &mut [u8]) -> Result<(), Error>
1.6.0[src]Read the exact number of bytes required to fill buf
. Read more
fn by_ref(&mut self) -> &mut Self
1.0.0[src]
fn by_ref(&mut self) -> &mut Self
1.0.0[src]Creates a “by reference” adaptor for this instance of Read
. Read more
impl Seek for File
[src]
impl Seek for File
[src]impl<'a> Seek for &'a File
[src]
impl<'a> Seek for &'a File
[src]impl Write for File
[src]
impl Write for File
[src]fn write(&mut self, buf: &[u8]) -> Result<usize>
[src]
fn write(&mut self, buf: &[u8]) -> Result<usize>
[src]Write a buffer into this writer, returning how many bytes were written. Read more
fn flush(&mut self) -> Result<()>
[src]
fn flush(&mut self) -> Result<()>
[src]Flush this output stream, ensuring that all intermediately buffered contents reach their destination. Read more
fn is_write_vectored(&self) -> bool
[src]
fn is_write_vectored(&self) -> bool
[src]can_vector
)Determines if this Write
r has an efficient write_vectored
implementation. Read more
fn write_all(&mut self, buf: &[u8]) -> Result<(), Error>
1.0.0[src]
fn write_all(&mut self, buf: &[u8]) -> Result<(), Error>
1.0.0[src]Attempts to write an entire buffer into this writer. Read more
fn write_all_vectored(&mut self, bufs: &mut [IoSlice<'_>]) -> Result<(), Error>
[src]
fn write_all_vectored(&mut self, bufs: &mut [IoSlice<'_>]) -> Result<(), Error>
[src]write_all_vectored
)Attempts to write multiple buffers into this writer. Read more
impl<'a> Write for &'a File
[src]
impl<'a> Write for &'a File
[src]fn write(&mut self, buf: &[u8]) -> Result<usize>
[src]
fn write(&mut self, buf: &[u8]) -> Result<usize>
[src]Write a buffer into this writer, returning how many bytes were written. Read more
fn flush(&mut self) -> Result<()>
[src]
fn flush(&mut self) -> Result<()>
[src]Flush this output stream, ensuring that all intermediately buffered contents reach their destination. Read more
fn is_write_vectored(&self) -> bool
[src]
fn is_write_vectored(&self) -> bool
[src]can_vector
)Determines if this Write
r has an efficient write_vectored
implementation. Read more
fn write_all(&mut self, buf: &[u8]) -> Result<(), Error>
1.0.0[src]
fn write_all(&mut self, buf: &[u8]) -> Result<(), Error>
1.0.0[src]Attempts to write an entire buffer into this writer. Read more
fn write_all_vectored(&mut self, bufs: &mut [IoSlice<'_>]) -> Result<(), Error>
[src]
fn write_all_vectored(&mut self, bufs: &mut [IoSlice<'_>]) -> Result<(), Error>
[src]write_all_vectored
)Attempts to write multiple buffers into this writer. Read more