pub struct File<'a, B: BlockDevice, S: FileSync = Safe> { /* private fields */ }Implementations§
Source§impl<'a, B: BlockDevice> File<'a, B, Safe>
impl<'a, B: BlockDevice> File<'a, B, Safe>
Sourcepub unsafe fn into_unsafe(self) -> File<'a, B, Unsafe>
pub unsafe fn into_unsafe(self) -> File<'a, B, Unsafe>
Remove the locking requirement for file Read/Writes.
Use only if sure that reads/writes will not happen on the same or multiple files by different cores at the same.
Sourcepub unsafe fn into_reader(self) -> Result<Reader<'a, B>, DeviceError>
pub unsafe fn into_reader(self) -> Result<Reader<'a, B>, DeviceError>
Transform the File into a high-speed Reader with better caching and locking mechanisms.
Source§impl<'a, B: BlockDevice> File<'a, B, Unsafe>
impl<'a, B: BlockDevice> File<'a, B, Unsafe>
Source§impl<'a, B: BlockDevice, S: FileSync> File<'a, B, S>
impl<'a, B: BlockDevice, S: FileSync> File<'a, B, S>
pub fn cursor(&self) -> usize
pub fn is_dirty(&self) -> bool
pub fn available(&self) -> usize
pub fn is_readable(&self) -> bool
pub fn is_writeable(&self) -> bool
pub fn is_allocated(&self) -> bool
pub fn volume(&self) -> &Volume<'a, B>
pub fn delete(self) -> Result<(), DeviceError>
pub fn close(self) -> Result<(), DeviceError>
pub fn flush(&mut self) -> Result<(), DeviceError>
pub fn write(&mut self, b: &[u8]) -> Result<usize, DeviceError>
Sourcepub fn truncate(&mut self, pos: usize) -> Result<(), DeviceError>
pub fn truncate(&mut self, pos: usize) -> Result<(), DeviceError>
Does not save the file and keeps the current Cluster intact. To fully truncate a File entry, it must be opened with ‘Mode::TRUNCATE’.
pub fn read(&mut self, b: &mut [u8]) -> Result<usize, DeviceError>
Methods from Deref<Target = DirEntry>§
pub fn size(&self) -> u32
pub fn name(&self) -> &str
pub fn offset(&self) -> u32
pub fn is_file(&self) -> bool
pub fn created(&self) -> &Time
pub fn attributes(&self) -> u8
pub fn modified(&self) -> &Time
pub fn cluster(&self) -> Cluster
pub fn is_directory(&self) -> bool
pub fn filename(&self) -> &ShortName
Trait Implementations§
Source§impl<B: BlockDevice, S: FileSync> Read<DeviceError> for File<'_, B, S>
impl<B: BlockDevice, S: FileSync> Read<DeviceError> for File<'_, B, S>
Source§impl<B: BlockDevice, S: FileSync> Seek<DeviceError> for File<'_, B, S>
impl<B: BlockDevice, S: FileSync> Seek<DeviceError> for File<'_, B, S>
Source§impl<B: BlockDevice, S: FileSync> Write<DeviceError> for File<'_, B, S>
impl<B: BlockDevice, S: FileSync> Write<DeviceError> for File<'_, B, S>
Auto Trait Implementations§
impl<'a, B, S> Freeze for File<'a, B, S>
impl<'a, B, S = Safe> !RefUnwindSafe for File<'a, B, S>
impl<'a, B, S = Safe> !Send for File<'a, B, S>
impl<'a, B, S = Safe> !Sync for File<'a, B, S>
impl<'a, B, S> Unpin for File<'a, B, S>
impl<'a, B, S = Safe> !UnwindSafe for File<'a, B, 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