pub enum ThreadingOptions {
Auto,
Fixed(usize),
Single,
}Expand description
How many worker threads a table-parallel scan may use.
Variants§
Auto
Use available parallelism, capped by the number of table files.
Fixed(usize)
Use an explicit worker count in 1..=512.
Single
Force one worker.
Implementations§
Source§impl ThreadingOptions
impl ThreadingOptions
Sourcepub fn resolve(self, work_items: usize) -> usize
pub fn resolve(self, work_items: usize) -> usize
Resolves this setting to a concrete worker count.
Sourcepub fn resolve_unchecked(self, work_items: usize) -> usize
pub fn resolve_unchecked(self, work_items: usize) -> usize
Resolves this setting without returning validation errors.
Sourcepub fn resolve_checked(self, work_items: usize) -> Result<usize>
pub fn resolve_checked(self, work_items: usize) -> Result<usize>
Resolves this setting and rejects invalid fixed worker counts.
§Errors
Returns LevelDbError::InvalidArgument when Fixed(0) or a value
above 512 is requested.
Trait Implementations§
Source§impl Clone for ThreadingOptions
impl Clone for ThreadingOptions
Source§fn clone(&self) -> ThreadingOptions
fn clone(&self) -> ThreadingOptions
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ThreadingOptions
impl Debug for ThreadingOptions
Source§impl Default for ThreadingOptions
impl Default for ThreadingOptions
Source§fn default() -> ThreadingOptions
fn default() -> ThreadingOptions
Returns the “default value” for a type. Read more
Source§impl PartialEq for ThreadingOptions
impl PartialEq for ThreadingOptions
Source§fn eq(&self, other: &ThreadingOptions) -> bool
fn eq(&self, other: &ThreadingOptions) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Copy for ThreadingOptions
impl Eq for ThreadingOptions
impl StructuralPartialEq for ThreadingOptions
Auto Trait Implementations§
impl Freeze for ThreadingOptions
impl RefUnwindSafe for ThreadingOptions
impl Send for ThreadingOptions
impl Sync for ThreadingOptions
impl Unpin for ThreadingOptions
impl UnsafeUnpin for ThreadingOptions
impl UnwindSafe for ThreadingOptions
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> 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>
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 more