pub struct MmapDataset { /* private fields */ }Expand description
Memory-mapped dataset for zero-copy access
Implementations§
Source§impl MmapDataset
impl MmapDataset
Sourcepub fn from_binary<P: AsRef<Path>>(
path: P,
n_samples: usize,
n_features: usize,
data_offset: usize,
config: LazyLoadConfig,
) -> Result<Self>
pub fn from_binary<P: AsRef<Path>>( path: P, n_samples: usize, n_features: usize, data_offset: usize, config: LazyLoadConfig, ) -> Result<Self>
Create a new memory-mapped dataset from a binary file
§Arguments
path- Path to the binary filen_samples- Number of samples in the datasetn_features- Number of features per sampledata_offset- Byte offset to the start of dataconfig- Lazy loading configuration
§Returns
Ok(MmapDataset)- The memory-mapped datasetErr(DatasetsError)- If mapping fails
Sourcepub fn n_features(&self) -> usize
pub fn n_features(&self) -> usize
Get the number of features
Sourcepub fn adaptive_chunk_size(&self) -> usize
pub fn adaptive_chunk_size(&self) -> usize
Calculate optimal chunk size based on memory pressure
Sourcepub fn iter_chunks(&self) -> LazyChunkIterator<'_> ⓘ
pub fn iter_chunks(&self) -> LazyChunkIterator<'_> ⓘ
Create an iterator over chunks with adaptive sizing
Auto Trait Implementations§
impl Freeze for MmapDataset
impl RefUnwindSafe for MmapDataset
impl Send for MmapDataset
impl Sync for MmapDataset
impl Unpin for MmapDataset
impl UnsafeUnpin for MmapDataset
impl UnwindSafe for MmapDataset
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
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>
Converts
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>
Converts
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> 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<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>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
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
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.