Struct segsource::MappedFileSource [−][src]
pub struct MappedFileSource { /* fields omitted */ }
Expand description
A U8Source
whose data is owned by a memory mapped file. This source can only use u8
s as
its item.
An important note: The mapped file is locked first via an advisory lock. This is to prevent changes to the file while it is mapped. However, this is just an advisory lock, and other processes may choose to ignore it. So, it’s best not to alter it while it’s mapped.
Implementations
Trait Implementations
The amount of data in the reader. If the reader’s size changes (which none of the implementations currently do), then this should return how much data was initially in the reader. Read more
Creates a new source with the provided initial offset, using the items in theVec
for its
data. Read more
Creates a segment from the start offset (inclusive) to the end offset (exclusive).
Creates a new source using the data in the Vec
for its data.
Checks to make sure that the provided offset is valid. If it is, then an Ok(())
will be
returned. Otherwise, the appropriate error will be returned. Read more
Returns a single segment containing all data in the source.
Gets a segment of n items, starting at the given offset.
Gets all items in the source before the provided offset (exclusive).
Gets all items in the source after the provided offset (inclusive).
The lowest valid offset that can be requested.
The highest valid offset that can be requested.
Creates a new source using the the provided file, Endidness
, and offset.
Creates a new source using the the provided Bytes, Endidness
, and offset.
An async version of U8Source::from_file_with_offset
.
Creates a new source using the the provided vec and Endidness
.
Creates a new source using the the provided vec, Endidness
, and offset.
Creates a new source using the the provided file and Endidness
.
An async version of U8Source::from_file
.
Auto Trait Implementations
impl RefUnwindSafe for MappedFileSource
impl Send for MappedFileSource
impl Sync for MappedFileSource
impl Unpin for MappedFileSource
impl UnwindSafe for MappedFileSource