Skip to main content

OutOfCoreConfig

Struct OutOfCoreConfig 

Source
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: f64

Fraction 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: usize

Bounded queue depth for pipeline stages.

§async_io: bool

Enable async pipeline stage execution.

Implementations§

Source§

impl OutOfCoreConfig

Source

pub fn with_memory_fraction(self, fraction: f64) -> Self

Set the fraction of available system memory to target.

Source

pub fn with_memory_budget_bytes(self, bytes: usize) -> Self

Set an explicit memory budget in bytes.

Source

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.

Source

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.

Source

pub fn with_async_io(self, enabled: bool) -> Self

Enable or disable async pipeline stage execution.

Source

pub fn try_with_parallelism(self, threads: usize) -> Result<Self>

Fallible variant of Self::with_parallelism.

§Errors

Returns an error if threads is 0.

Source

pub fn try_with_queue_depth(self, depth: usize) -> Result<Self>

Fallible variant of Self::with_queue_depth.

§Errors

Returns an error if depth is 0.

Source

pub fn effective_parallelism(&self) -> usize

Return the configured worker thread count, clamped to at least 1.

Source

pub fn effective_queue_depth(&self) -> usize

Return the configured queue depth, clamped to at least 1.

Source

pub fn use_threaded_pipeline(&self) -> bool

Returns true when the threaded pipeline should be used.

Source

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

Source§

fn clone(&self) -> OutOfCoreConfig

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for OutOfCoreConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for OutOfCoreConfig

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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 more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.