pub struct MemoryMappedSlice<A, D>{ /* private fields */ }Expand description
A slice of a memory-mapped array that maintains memory-mapping.
This provides a view into a subset of a memory-mapped array without loading the entire array into memory. Data is only loaded when accessed through the slice.
Implementations§
Source§impl<A, D> MemoryMappedSlice<A, D>
impl<A, D> MemoryMappedSlice<A, D>
Sourcepub fn new(
source: MemoryMappedArray<A>,
slice_info: SliceInfo<Vec<SliceInfoElem>, D, D>,
) -> Self
pub fn new( source: MemoryMappedArray<A>, slice_info: SliceInfo<Vec<SliceInfoElem>, D, D>, ) -> Self
Creates a new slice from a memory-mapped array and slice information.
Sourcepub fn shape(&self) -> D
pub fn shape(&self) -> D
Returns the shape of the slice.
Note: This is a simplified version for backward compatibility.
For the accurate calculated shape, use calculatedshape().
Sourcepub fn calculatedshape(&self) -> CoreResult<D>
pub fn calculatedshape(&self) -> CoreResult<D>
Returns the accurately calculated shape of the slice.
Calculates the actual shape based on the slice parameters and source shape.
Sourcepub const fn source(&self) -> &MemoryMappedArray<A>
pub const fn source(&self) -> &MemoryMappedArray<A>
Returns a reference to the source memory-mapped array.
Sourcepub const fn slice_info(&self) -> &SliceInfo<Vec<SliceInfoElem>, D, D>
pub const fn slice_info(&self) -> &SliceInfo<Vec<SliceInfoElem>, D, D>
Returns the slice information.
Sourcepub fn load(&self) -> CoreResult<ArrayBase<OwnedRepr<A>, D>>
pub fn load(&self) -> CoreResult<ArrayBase<OwnedRepr<A>, D>>
Loads the slice data into memory.
This method materializes the slice by loading only the necessary data from the memory-mapped file.
Auto Trait Implementations§
impl<A, D> Freeze for MemoryMappedSlice<A, D>
impl<A, D> RefUnwindSafe for MemoryMappedSlice<A, D>where
D: RefUnwindSafe,
A: RefUnwindSafe,
impl<A, D> Send for MemoryMappedSlice<A, D>
impl<A, D> Sync for MemoryMappedSlice<A, D>
impl<A, D> Unpin for MemoryMappedSlice<A, D>
impl<A, D> UnwindSafe for MemoryMappedSlice<A, D>where
D: UnwindSafe,
A: 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
Source§impl<T> CheckedAs for T
impl<T> CheckedAs for T
Source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
Source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
Source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> OverflowingAs for T
impl<T> OverflowingAs for T
Source§fn overflowing_as<Dst>(self) -> (Dst, bool)where
T: OverflowingCast<Dst>,
fn overflowing_as<Dst>(self) -> (Dst, bool)where
T: OverflowingCast<Dst>,
Source§impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere
Src: OverflowingCast<Dst>,
impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere
Src: OverflowingCast<Dst>,
Source§fn overflowing_cast_from(src: Src) -> (Dst, bool)
fn overflowing_cast_from(src: Src) -> (Dst, bool)
Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> SaturatingAs for T
impl<T> SaturatingAs for T
Source§fn saturating_as<Dst>(self) -> Dstwhere
T: SaturatingCast<Dst>,
fn saturating_as<Dst>(self) -> Dstwhere
T: SaturatingCast<Dst>,
Source§impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere
Src: SaturatingCast<Dst>,
impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere
Src: SaturatingCast<Dst>,
Source§fn saturating_cast_from(src: Src) -> Dst
fn saturating_cast_from(src: Src) -> Dst
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.