pub struct OutOfCoreConfig {
pub memory_fraction: f64,
pub memory_budget_bytes: Option<usize>,
pub parallelism: Option<usize>,
pub queue_depth: usize,
pub async_io: bool,
}Expand description
Configuration for out-of-core batching.
Fields§
§memory_fraction: f64Fraction of available system memory to target (0.0 < fraction <= 1.0).
memory_budget_bytes: Option<usize>Explicit memory budget override (bytes). If set, memory_fraction is ignored.
parallelism: Option<usize>Optional number of worker threads for parallel slice processing.
queue_depth: usizeBounded queue depth for pipeline stages.
async_io: boolEnable async pipeline stage execution.
Implementations§
Source§impl OutOfCoreConfig
impl OutOfCoreConfig
Sourcepub fn with_memory_fraction(self, fraction: f64) -> Self
pub fn with_memory_fraction(self, fraction: f64) -> Self
Set the fraction of available system memory to target.
Sourcepub fn with_memory_budget_bytes(self, bytes: usize) -> Self
pub fn with_memory_budget_bytes(self, bytes: usize) -> Self
Set an explicit memory budget in bytes.
Sourcepub fn with_parallelism(self, threads: usize) -> Self
pub fn with_parallelism(self, threads: usize) -> Self
Set the number of worker threads for slice processing.
Values less than 1 are clamped to 1. Use Self::try_with_parallelism
to surface invalid values as an error instead.
Sourcepub fn with_queue_depth(self, depth: usize) -> Self
pub fn with_queue_depth(self, depth: usize) -> Self
Set the bounded queue depth for pipeline stages.
Values less than 1 are clamped to 1. Use Self::try_with_queue_depth
to surface invalid values as an error instead.
Sourcepub fn with_async_io(self, enabled: bool) -> Self
pub fn with_async_io(self, enabled: bool) -> Self
Enable or disable async pipeline stage execution.
Sourcepub fn try_with_parallelism(self, threads: usize) -> Result<Self>
pub fn try_with_parallelism(self, threads: usize) -> Result<Self>
Sourcepub fn try_with_queue_depth(self, depth: usize) -> Result<Self>
pub fn try_with_queue_depth(self, depth: usize) -> Result<Self>
Sourcepub fn effective_parallelism(&self) -> usize
pub fn effective_parallelism(&self) -> usize
Return the configured worker thread count, clamped to at least 1.
Sourcepub fn effective_queue_depth(&self) -> usize
pub fn effective_queue_depth(&self) -> usize
Return the configured queue depth, clamped to at least 1.
Sourcepub fn use_threaded_pipeline(&self) -> bool
pub fn use_threaded_pipeline(&self) -> bool
Returns true when the threaded pipeline should be used.
Sourcepub fn resolve_budget_bytes(&self) -> Result<usize>
pub fn resolve_budget_bytes(&self) -> Result<usize>
Resolve the target memory budget in bytes.
§Errors
Returns an error if the memory fraction is invalid or system memory cannot be queried.
Trait Implementations§
Source§impl Clone for OutOfCoreConfig
impl Clone for OutOfCoreConfig
Source§fn clone(&self) -> OutOfCoreConfig
fn clone(&self) -> OutOfCoreConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for OutOfCoreConfig
impl Debug for OutOfCoreConfig
Auto Trait Implementations§
impl Freeze for OutOfCoreConfig
impl RefUnwindSafe for OutOfCoreConfig
impl Send for OutOfCoreConfig
impl Sync for OutOfCoreConfig
impl Unpin for OutOfCoreConfig
impl UnwindSafe for OutOfCoreConfig
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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 more