pub struct MemmapArrayMut<T: Element> { /* private fields */ }Expand description
A read-write memory-mapped array backed by a .npy file.
Modifications to the array data are written back to the underlying file.
Implementations§
Source§impl<T: Element> MemmapArrayMut<T>
impl<T: Element> MemmapArrayMut<T>
Sourcepub fn as_slice_mut(&mut self) -> &mut [T]
pub fn as_slice_mut(&mut self) -> &mut [T]
Return the mapped data as a mutable slice.
Modifications will be persisted to the file (for ReadWrite mode) or kept in memory only (for CopyOnWrite mode).
Sourcepub fn to_array(&self) -> FerrayResult<Array<T, IxDyn>>
pub fn to_array(&self) -> FerrayResult<Array<T, IxDyn>>
Copy the memory-mapped data into an owned Array.
Sourcepub fn view(&self) -> ArrayView<'_, T, IxDyn>
pub fn view(&self) -> ArrayView<'_, T, IxDyn>
Borrow the memory-mapped data as an immutable
ArrayView<T, IxDyn>. See MemmapArray::view for the
rationale (#496).
Sourcepub fn flush(&self) -> FerrayResult<()>
pub fn flush(&self) -> FerrayResult<()>
Flush changes to disk (only meaningful for ReadWrite mode).
Trait Implementations§
impl<T: Element> Send for MemmapArrayMut<T>
impl<T: Element> Sync for MemmapArrayMut<T>
Auto Trait Implementations§
impl<T> Freeze for MemmapArrayMut<T>
impl<T> RefUnwindSafe for MemmapArrayMut<T>where
T: RefUnwindSafe,
impl<T> Unpin for MemmapArrayMut<T>where
T: Unpin,
impl<T> UnsafeUnpin for MemmapArrayMut<T>
impl<T> UnwindSafe for MemmapArrayMut<T>where
T: RefUnwindSafe + UnwindSafe,
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