Skip to main content

MemoryFile

Struct MemoryFile 

Source
pub struct MemoryFile { /* private fields */ }
Expand description

A handle to one in-memory file.

Trait Implementations§

Source§

impl Drop for MemoryFile

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more
Source§

impl File for MemoryFile

Source§

fn read_exact_at(&self, buf: &mut [u8], offset: u64) -> Result<()>

Fill buf from the file starting at byte offset. Read more
Source§

fn write_all_at(&mut self, buf: &[u8], offset: u64) -> Result<()>

Write all of buf to the file starting at byte offset, extending the file if necessary.
Source§

fn truncate(&mut self, size: u64) -> Result<()>

Truncate or extend the file to exactly size bytes.
Source§

fn sync(&mut self) -> Result<()>

Flush buffered writes to durable storage.
Source§

fn size(&self) -> Result<u64>

The current size of the file in bytes.
Source§

fn lock(&mut self, level: LockLevel) -> Result<()>

Acquire (or upgrade to) the given lock level, returning Error::Busy if an incompatible lock is held. Read more
Source§

fn unlock(&mut self, level: LockLevel) -> Result<()>

Release down to the given lock level. Never fails for the built-in VFSs.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.