pub struct File<'a, IO: ReadWriteSeek, TP, OCC> { /* private fields */ }Expand description
A FAT filesystem file object used for reading and writing data.
This struct is created by the open_file or create_file methods on Dir.
Implementations§
source§impl<'a, IO: ReadWriteSeek, TP, OCC> File<'a, IO, TP, OCC>
impl<'a, IO: ReadWriteSeek, TP, OCC> File<'a, IO, TP, OCC>
sourcepub fn extents(
&mut self
) -> impl Iterator<Item = Result<Extent, Error<IO::Error>>> + 'a
pub fn extents( &mut self ) -> impl Iterator<Item = Result<Extent, Error<IO::Error>>> + 'a
Get the extents of a file on disk.
This returns an iterator over the byte ranges on-disk occupied by this file.
sourcepub fn set_created(&mut self, date_time: DateTime)
👎Deprecated
pub fn set_created(&mut self, date_time: DateTime)
Sets date and time of creation for this file.
Note: it is set to a value from the TimeProvider when creating a file.
Deprecated: if needed implement a custom TimeProvider.
sourcepub fn set_accessed(&mut self, date: Date)
👎Deprecated
pub fn set_accessed(&mut self, date: Date)
Sets date of last access for this file.
Note: it is overwritten by a value from the TimeProvider on every file read operation.
Deprecated: if needed implement a custom TimeProvider.
sourcepub fn set_modified(&mut self, date_time: DateTime)
👎Deprecated
pub fn set_modified(&mut self, date_time: DateTime)
Sets date and time of last modification for this file.
Note: it is overwritten by a value from the TimeProvider on every file write operation.
Deprecated: if needed implement a custom TimeProvider.
Trait Implementations§
source§impl<IO: ReadWriteSeek, TP, OCC> Clone for File<'_, IO, TP, OCC>
impl<IO: ReadWriteSeek, TP, OCC> Clone for File<'_, IO, TP, OCC>
source§impl<IO: ReadWriteSeek, TP, OCC> Drop for File<'_, IO, TP, OCC>
impl<IO: ReadWriteSeek, TP, OCC> Drop for File<'_, IO, TP, OCC>
source§impl<IO: ReadWriteSeek, TP, OCC> Io for File<'_, IO, TP, OCC>
impl<IO: ReadWriteSeek, TP, OCC> Io for File<'_, IO, TP, OCC>
source§impl<IO: ReadWriteSeek, TP: TimeProvider, OCC> Read for File<'_, IO, TP, OCC>where
Error: From<Error<IO::Error>>,
impl<IO: ReadWriteSeek, TP: TimeProvider, OCC> Read for File<'_, IO, TP, OCC>where Error: From<Error<IO::Error>>,
source§fn read(&mut self, buf: &mut [u8]) -> Result<usize>
fn read(&mut self, buf: &mut [u8]) -> Result<usize>
1.36.0 · source§fn read_vectored(&mut self, bufs: &mut [IoSliceMut<'_>]) -> Result<usize, Error>
fn read_vectored(&mut self, bufs: &mut [IoSliceMut<'_>]) -> Result<usize, Error>
read, except that it reads into a slice of buffers. Read moresource§fn is_read_vectored(&self) -> bool
fn is_read_vectored(&self) -> bool
can_vector)1.0.0 · source§fn read_to_end(&mut self, buf: &mut Vec<u8, Global>) -> Result<usize, Error>
fn read_to_end(&mut self, buf: &mut Vec<u8, Global>) -> Result<usize, Error>
buf. Read more1.0.0 · source§fn read_to_string(&mut self, buf: &mut String) -> Result<usize, Error>
fn read_to_string(&mut self, buf: &mut String) -> Result<usize, Error>
buf. Read more1.6.0 · source§fn read_exact(&mut self, buf: &mut [u8]) -> Result<(), Error>
fn read_exact(&mut self, buf: &mut [u8]) -> Result<(), Error>
buf. Read moresource§fn read_buf(&mut self, buf: BorrowedCursor<'_>) -> Result<(), Error>
fn read_buf(&mut self, buf: BorrowedCursor<'_>) -> Result<(), Error>
read_buf)source§fn read_buf_exact(&mut self, cursor: BorrowedCursor<'_>) -> Result<(), Error>
fn read_buf_exact(&mut self, cursor: BorrowedCursor<'_>) -> Result<(), Error>
read_buf)cursor. Read more1.0.0 · source§fn by_ref(&mut self) -> &mut Selfwhere
Self: Sized,
fn by_ref(&mut self) -> &mut Selfwhere Self: Sized,
Read. Read moresource§impl<IO: ReadWriteSeek, TP: TimeProvider, OCC> Read for File<'_, IO, TP, OCC>
impl<IO: ReadWriteSeek, TP: TimeProvider, OCC> Read for File<'_, IO, TP, OCC>
source§fn read(&mut self, buf: &mut [u8]) -> Result<usize, Self::Error>
fn read(&mut self, buf: &mut [u8]) -> Result<usize, Self::Error>
source§fn read_exact(
&mut self,
buf: &mut [u8]
) -> Result<(), ReadExactError<Self::Error>>
fn read_exact( &mut self, buf: &mut [u8] ) -> Result<(), ReadExactError<Self::Error>>
buf.source§impl<IO: ReadWriteSeek, TP: TimeProvider, OCC> Seek for File<'_, IO, TP, OCC>where
Error: From<Error<IO::Error>>,
impl<IO: ReadWriteSeek, TP: TimeProvider, OCC> Seek for File<'_, IO, TP, OCC>where Error: From<Error<IO::Error>>,
source§fn seek(&mut self, pos: SeekFrom) -> Result<u64>
fn seek(&mut self, pos: SeekFrom) -> Result<u64>
1.55.0 · source§fn rewind(&mut self) -> Result<(), Error>
fn rewind(&mut self) -> Result<(), Error>
source§impl<IO: ReadWriteSeek, TP, OCC> Seek for File<'_, IO, TP, OCC>
impl<IO: ReadWriteSeek, TP, OCC> Seek for File<'_, IO, TP, OCC>
source§impl<IO: ReadWriteSeek, TP: TimeProvider, OCC> Write for File<'_, IO, TP, OCC>where
Error: From<Error<IO::Error>>,
impl<IO: ReadWriteSeek, TP: TimeProvider, OCC> Write for File<'_, IO, TP, OCC>where Error: From<Error<IO::Error>>,
source§fn write(&mut self, buf: &[u8]) -> Result<usize>
fn write(&mut self, buf: &[u8]) -> Result<usize>
source§fn write_all(&mut self, buf: &[u8]) -> Result<()>
fn write_all(&mut self, buf: &[u8]) -> Result<()>
source§fn flush(&mut self) -> Result<()>
fn flush(&mut self) -> Result<()>
source§fn is_write_vectored(&self) -> bool
fn is_write_vectored(&self) -> bool
can_vector)source§fn write_all_vectored(&mut self, bufs: &mut [IoSlice<'_>]) -> Result<(), Error>
fn write_all_vectored(&mut self, bufs: &mut [IoSlice<'_>]) -> Result<(), Error>
write_all_vectored)