pub struct MappedObjects {
mappings: Vec<Arc<Mmap>>,
}Expand description
Read-only file mappings, numbered in the order passed to Self::open.
Fields§
§mappings: Vec<Arc<Mmap>>Implementations§
Source§impl MappedObjects
impl MappedObjects
Sourcepub fn open<'a>(paths: impl IntoIterator<Item = &'a Path>) -> Result<Self>
pub fn open<'a>(paths: impl IntoIterator<Item = &'a Path>) -> Result<Self>
Map files read-only, assigning object IDs from zero in iteration order. Files must remain unchanged while any returned mapping is alive.
Sourcepub fn mapping(&self, id: ObjectId) -> Result<&Mmap>
pub fn mapping(&self, id: ObjectId) -> Result<&Mmap>
Borrow an entire object mapping; fail if the object index is out of range. The caller must use IDs from this source.
Sourcepub fn bytes(&self, span: &DataSpan) -> Result<&[u8]>
pub fn bytes(&self, span: &DataSpan) -> Result<&[u8]>
Borrow a byte range after checking its object ID and bounds.
Sourcepub fn view(&self, span: &DataSpan) -> Result<MappedBytes>
pub fn view(&self, span: &DataSpan) -> Result<MappedBytes>
Retain a byte range without copying its contents, checking ID and bounds.
Trait Implementations§
Source§impl ByteSource for MappedObjects
impl ByteSource for MappedObjects
Source§impl Clone for MappedObjects
impl Clone for MappedObjects
Source§fn clone(&self) -> MappedObjects
fn clone(&self) -> MappedObjects
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Default for MappedObjects
impl Default for MappedObjects
Source§fn default() -> MappedObjects
fn default() -> MappedObjects
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for MappedObjects
impl RefUnwindSafe for MappedObjects
impl Send for MappedObjects
impl Sync for MappedObjects
impl Unpin for MappedObjects
impl UnsafeUnpin for MappedObjects
impl UnwindSafe for MappedObjects
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more