pub struct OutOfCoreArray<A, D>where
A: Clone + Serialize + for<'de> Deserialize<'de>,
D: Dimension + Serialize + for<'de> Deserialize<'de>,{ /* private fields */ }Expand description
An array that stores data on disk to reduce memory usage
Implementations§
Source§impl<A, D> OutOfCoreArray<A, D>where
A: Clone + Serialize + for<'de> Deserialize<'de>,
D: Dimension + Serialize + for<'de> Deserialize<'de>,
impl<A, D> OutOfCoreArray<A, D>where
A: Clone + Serialize + for<'de> Deserialize<'de>,
D: Dimension + Serialize + for<'de> Deserialize<'de>,
Source§impl<A, D> OutOfCoreArray<A, D>where
A: Clone + Serialize + for<'de> Deserialize<'de>,
D: Dimension + Serialize + for<'de> Deserialize<'de>,
impl<A, D> OutOfCoreArray<A, D>where
A: Clone + Serialize + for<'de> Deserialize<'de>,
D: Dimension + Serialize + for<'de> Deserialize<'de>,
Sourcepub fn new<S>(
data: &ArrayBase<S, D>,
file_path: &Path,
strategy: ChunkingStrategy,
) -> Result<Self, CoreError>where
S: Data<Elem = A>,
pub fn new<S>(
data: &ArrayBase<S, D>,
file_path: &Path,
strategy: ChunkingStrategy,
) -> Result<Self, CoreError>where
S: Data<Elem = A>,
Create a new out-of-core array with the given data and file path
This uses the V2 format by default for efficient chunk-based access.
Use new_v1() if you need backward compatibility with the V1 format.
Sourcepub fn new_v1<S>(
data: &ArrayBase<S, D>,
file_path: &Path,
strategy: ChunkingStrategy,
) -> Result<Self, CoreError>where
S: Data<Elem = A>,
pub fn new_v1<S>(
data: &ArrayBase<S, D>,
file_path: &Path,
strategy: ChunkingStrategy,
) -> Result<Self, CoreError>where
S: Data<Elem = A>,
Create a new out-of-core array using V1 format (legacy)
This method is provided for backward compatibility. New code should use new() instead.
Sourcepub fn open(file_path: &Path) -> Result<Self, CoreError>
pub fn open(file_path: &Path) -> Result<Self, CoreError>
Open an existing out-of-core array file with automatic version detection
This method detects whether the file is in V1 or V2 format and loads it accordingly.
Sourcepub fn migrate_to_v2(
&self,
new_file_path: &Path,
compression: CompressionType,
) -> Result<Self, CoreError>
pub fn migrate_to_v2( &self, new_file_path: &Path, compression: CompressionType, ) -> Result<Self, CoreError>
Migrate a V1 format file to V2 format
This creates a new V2 file at the specified path with the data from this array.
Returns a new OutOfCoreArray using the V2 format.
Sourcepub fn new_temp<S>(
data: &ArrayBase<S, D>,
strategy: ChunkingStrategy,
) -> Result<Self, CoreError>where
S: Data<Elem = A>,
pub fn new_temp<S>(
data: &ArrayBase<S, D>,
strategy: ChunkingStrategy,
) -> Result<Self, CoreError>where
S: Data<Elem = A>,
Create a new out-of-core array with a temporary file
Uses V2 format by default for efficient chunk-based access.
Sourcepub fn load_chunk(&self, chunkindex: usize) -> Result<Array<A, D>, CoreError>
pub fn load_chunk(&self, chunkindex: usize) -> Result<Array<A, D>, CoreError>
Load a chunk of the array into memory
For V2 format, this efficiently seeks to and loads only the requested chunk. For V1 format (legacy), this loads the entire array and extracts the chunk.
Sourcepub fn num_chunks(&self) -> usize
pub fn num_chunks(&self) -> usize
Get the number of chunks
Trait Implementations§
Source§impl<A, D> Debug for OutOfCoreArray<A, D>where
A: Clone + Serialize + for<'de> Deserialize<'de> + Debug,
D: Dimension + Serialize + for<'de> Deserialize<'de> + Debug,
impl<A, D> Debug for OutOfCoreArray<A, D>where
A: Clone + Serialize + for<'de> Deserialize<'de> + Debug,
D: Dimension + Serialize + for<'de> Deserialize<'de> + Debug,
Source§impl<A, D> Drop for OutOfCoreArray<A, D>where
A: Clone + Serialize + for<'de> Deserialize<'de>,
D: Dimension + Serialize + for<'de> Deserialize<'de>,
impl<A, D> Drop for OutOfCoreArray<A, D>where
A: Clone + Serialize + for<'de> Deserialize<'de>,
D: Dimension + Serialize + for<'de> Deserialize<'de>,
Auto Trait Implementations§
impl<A, D> Freeze for OutOfCoreArray<A, D>
impl<A, D> RefUnwindSafe for OutOfCoreArray<A, D>where
A: RefUnwindSafe,
D: RefUnwindSafe,
impl<A, D> Send for OutOfCoreArray<A, D>where
A: Send,
impl<A, D> Sync for OutOfCoreArray<A, D>where
A: Sync,
impl<A, D> Unpin for OutOfCoreArray<A, D>
impl<A, D> UnwindSafe for OutOfCoreArray<A, D>where
A: UnwindSafe,
D: 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<T> StrictAs for T
impl<T> StrictAs for T
Source§fn strict_as<Dst>(self) -> Dstwhere
T: StrictCast<Dst>,
fn strict_as<Dst>(self) -> Dstwhere
T: StrictCast<Dst>,
Source§impl<Src, Dst> StrictCastFrom<Src> for Dstwhere
Src: StrictCast<Dst>,
impl<Src, Dst> StrictCastFrom<Src> for Dstwhere
Src: StrictCast<Dst>,
Source§fn strict_cast_from(src: Src) -> Dst
fn strict_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.