Struct mmap_safe::MappedFile

source ·
pub struct MappedFile { /* private fields */ }
Expand description

A thin, safe wrapper for memory-mapped files.

This wrapper ensures memory safety by only providing one mutable reference at a time and by locking the file exclusively.

Implementations§

Returns mapped memory for the file.

Returns mutably-mapped memory for the file.

Resizes the file. When grown, it is guaranteed that all mapped memory regions on this file stay valid. When the file gets shrunk, the behaviour of regions behind the new end of the file is undefined.

Returns the current size of the file.

Converts this instance into a mutable mapping. If you want to convert it back, call IntoMutMapping::unmap.

Trait Implementations§

Executes the destructor for this type. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.