Trait File

Source
pub trait File:
    Read
    + Write
    + Seek
    + Send
    + Sync {
    // Required methods
    fn metadata(&self) -> Result<Metadata>;
    fn set_len(&self, new_size: u64) -> Result<()>;

    // Provided method
    fn as_file(&mut self) -> &mut Self
       where Self: Sized { ... }
}

Required Methods§

Source

fn metadata(&self) -> Result<Metadata>

Source

fn set_len(&self, new_size: u64) -> Result<()>

Truncates or extends the size of the file. If the file is extended, the file will be null-padded at the end. The file cursor never changes when truncating or extending, even if the cursor would be put outside the file bounds by this operation.

Provided Methods§

Source

fn as_file(&mut self) -> &mut Self
where Self: Sized,

Casts a mutable reference to this file into &mut luminol_filesystem::File.

Trait Implementations§

Source§

impl File for Box<dyn File>

Source§

fn metadata(&self) -> Result<Metadata>

Source§

fn set_len(&self, new_size: u64) -> Result<()>

Truncates or extends the size of the file. If the file is extended, the file will be null-padded at the end. The file cursor never changes when truncating or extending, even if the cursor would be put outside the file bounds by this operation.
Source§

fn as_file(&mut self) -> &mut Self
where Self: Sized,

Casts a mutable reference to this file into &mut luminol_filesystem::File.

Implementations on Foreign Types§

Source§

impl File for Box<dyn File>

Source§

fn metadata(&self) -> Result<Metadata>

Source§

fn set_len(&self, new_size: u64) -> Result<()>

Source§

impl<T> File for &mut T
where T: File + ?Sized,

Source§

fn metadata(&self) -> Result<Metadata>

Source§

fn set_len(&self, new_size: u64) -> Result<()>

Implementors§

Source§

impl File for luminol_filesystem::project::File

Source§

impl File for luminol_filesystem::native::File

Source§

impl<T> File for luminol_filesystem::archiver::File<T>
where T: File,