#[non_exhaustive]pub enum BatchStrategy {
Auto,
Sequential,
Outer,
Inner,
Split {
lanes: NonZeroUsize,
},
}Expand description
How the items of a batch are split over a thread budget.
§Examples
use tcontract_exec::batch::BatchStrategy;
assert_eq!(BatchStrategy::default(), BatchStrategy::Auto);Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Auto
Choose from the WorkModel and the query’s route capabilities.
Sequential
One lane, one item thread: no parallelism at all.
Outer
lanes = min(budget, items), each item serial.
Inner
One lane; the item kernel gets the whole budget.
Split
Exactly lanes lanes (clamped to the items and the budget), the rest
of the budget split evenly as item threads. A route that cannot run item
threads inside a lane refuses the resulting decision with
crate::ExecError::StrategyUnavailable before any write; it never silently
runs the items serially (see BatchDecision’s route contract).
Fields
§
lanes: NonZeroUsizeRequested lane count.
Trait Implementations§
Source§impl Clone for BatchStrategy
impl Clone for BatchStrategy
impl Copy for BatchStrategy
Source§impl Debug for BatchStrategy
impl Debug for BatchStrategy
Source§impl Default for BatchStrategy
impl Default for BatchStrategy
impl Eq for BatchStrategy
Source§impl PartialEq for BatchStrategy
impl PartialEq for BatchStrategy
impl StructuralPartialEq for BatchStrategy
Auto Trait Implementations§
impl Freeze for BatchStrategy
impl RefUnwindSafe for BatchStrategy
impl Send for BatchStrategy
impl Sync for BatchStrategy
impl Unpin for BatchStrategy
impl UnsafeUnpin for BatchStrategy
impl UnwindSafe for BatchStrategy
Blanket Implementations§
impl<T> Boilerplate for T
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,
impl<T, U> Imply<T> for U
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