Skip to main content

StorageFile

Trait StorageFile 

Source
pub trait StorageFile:
    Read
    + Write
    + Seek {
    // Required method
    fn set_len(&mut self, new_size: u64) -> Result<()>;
}
Expand description

A trait representing a file-like reader/writer.

This trait is the combination of the std::io stream traits with an additional method to resize the file.

Required Methods§

Source

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

Resize the file. This method behaves the same as File::set_len.

§Errors

See File::set_len for reasons this function could error.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl StorageFile for &File

Source§

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

Source§

impl StorageFile for Cursor<&mut Vec<u8>>

Source§

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

Source§

impl StorageFile for Cursor<Vec<u8>>

Source§

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

Source§

impl StorageFile for File

Source§

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

Source§

impl<T: StorageFile> StorageFile for &mut T

Source§

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

Implementors§