pub struct RWFile<'a, S>{ /* private fields */ }Expand description
A read-write file within a FAT filesystem
The size of the file will be automatically adjusted if the cursor goes beyond EOF.
To reduce a file’s size, use the truncate method
Implementations§
Source§impl<S> RWFile<'_, S>
impl<S> RWFile<'_, S>
Sourcepub fn set_accessed(&mut self, accessed: Date)
pub fn set_accessed(&mut self, accessed: Date)
Set the last accessed Date attribute of this file
Sourcepub fn set_created(&mut self, created: PrimitiveDateTime)
pub fn set_created(&mut self, created: PrimitiveDateTime)
Set the creation DateTime attributes of this file
Sourcepub fn set_modified(&mut self, modified: PrimitiveDateTime)
pub fn set_modified(&mut self, modified: PrimitiveDateTime)
Set the last modified DateTime attributes of this file
Methods from Deref<Target = Properties>§
Sourcepub fn attributes(&self) -> &Attributes
pub fn attributes(&self) -> &Attributes
Get the corresponding Attributes to this entry
Sourcepub fn creation_time(&self) -> &Option<PrimitiveDateTime>
pub fn creation_time(&self) -> &Option<PrimitiveDateTime>
Find out when this entry was created (max resolution: 1ms)
Returns an Option containing a PrimitiveDateTime from the time crate,
since that field is specified as optional in the FAT32 specification
Sourcepub fn modification_time(&self) -> &PrimitiveDateTime
pub fn modification_time(&self) -> &PrimitiveDateTime
Find out when this entry was last modified (max resolution: 2 secs)
Returns a PrimitiveDateTime from the time crate
Sourcepub fn last_accessed_date(&self) -> &Option<Date>
pub fn last_accessed_date(&self) -> &Option<Date>
Trait Implementations§
Source§impl<S> Read for RWFile<'_, S>
impl<S> Read for RWFile<'_, S>
Source§fn read(&mut self, buf: &mut [u8]) -> Result<usize, Self::Error>
fn read(&mut self, buf: &mut [u8]) -> Result<usize, Self::Error>
Read some bytes from this source into the specified buffer, returning how many bytes were read. Read more
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>>
Read the exact number of bytes required to fill
buf. Read moreSource§impl<S> Seek for RWFile<'_, S>
impl<S> Seek for RWFile<'_, S>
Source§impl<S> Write for RWFile<'_, S>
impl<S> Write for RWFile<'_, S>
Source§fn write(&mut self, buf: &[u8]) -> Result<usize, Self::Error>
fn write(&mut self, buf: &[u8]) -> Result<usize, Self::Error>
Write a buffer into this writer, returning how many bytes were written. Read more
Source§fn flush(&mut self) -> Result<(), Self::Error>
fn flush(&mut self) -> Result<(), Self::Error>
Flush this output stream, blocking until all intermediately buffered contents reach their destination.
Auto Trait Implementations§
impl<'a, S> Freeze for RWFile<'a, S>
impl<'a, S> !RefUnwindSafe for RWFile<'a, S>
impl<'a, S> !Send for RWFile<'a, S>
impl<'a, S> !Sync for RWFile<'a, S>
impl<'a, S> Unpin for RWFile<'a, S>
impl<'a, S> !UnwindSafe for RWFile<'a, S>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more