pub struct CpuBatchPolicy { /* private fields */ }Expand description
A batch strategy together with the thresholds Auto uses.
§Examples
use tenferro_cpu::{CpuBatchPolicy, CpuBatchStrategy, CpuBatchThresholds};
let policy = CpuBatchPolicy::default()
.with_thresholds(CpuBatchThresholds::default().with_outer_min_items(8));
assert_eq!(policy.strategy(), CpuBatchStrategy::Auto);
assert_eq!(policy.thresholds().outer_min_items(), 8);Implementations§
Source§impl CpuBatchPolicy
impl CpuBatchPolicy
Sourcepub fn new(strategy: CpuBatchStrategy) -> Self
pub fn new(strategy: CpuBatchStrategy) -> Self
A policy with strategy and the default thresholds.
§Examples
use tenferro_cpu::{CpuBatchPolicy, CpuBatchStrategy};
let policy = CpuBatchPolicy::new(CpuBatchStrategy::WholeBatchVendor);
assert_eq!(policy.strategy(), CpuBatchStrategy::WholeBatchVendor);Sourcepub fn with_thresholds(self, thresholds: CpuBatchThresholds) -> Self
pub fn with_thresholds(self, thresholds: CpuBatchThresholds) -> Self
Return this policy with different thresholds.
§Examples
use tenferro_cpu::{CpuBatchPolicy, CpuBatchThresholds};
let policy = CpuBatchPolicy::default().with_thresholds(CpuBatchThresholds::default());
assert_eq!(policy, CpuBatchPolicy::default());Sourcepub fn strategy(&self) -> CpuBatchStrategy
pub fn strategy(&self) -> CpuBatchStrategy
The selected strategy.
§Examples
use tenferro_cpu::{CpuBatchPolicy, CpuBatchStrategy};
assert_eq!(CpuBatchPolicy::default().strategy(), CpuBatchStrategy::Auto);Sourcepub fn thresholds(&self) -> CpuBatchThresholds
pub fn thresholds(&self) -> CpuBatchThresholds
The thresholds Auto applies.
§Examples
use tenferro_cpu::{CpuBatchPolicy, CpuBatchThresholds};
assert_eq!(CpuBatchPolicy::default().thresholds(), CpuBatchThresholds::default());Trait Implementations§
Source§impl Clone for CpuBatchPolicy
impl Clone for CpuBatchPolicy
Source§fn clone(&self) -> CpuBatchPolicy
fn clone(&self) -> CpuBatchPolicy
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 moreimpl Copy for CpuBatchPolicy
Source§impl Debug for CpuBatchPolicy
impl Debug for CpuBatchPolicy
Source§impl Default for CpuBatchPolicy
impl Default for CpuBatchPolicy
Source§fn default() -> CpuBatchPolicy
fn default() -> CpuBatchPolicy
Returns the “default value” for a type. Read more
impl Eq for CpuBatchPolicy
Source§impl Hash for CpuBatchPolicy
impl Hash for CpuBatchPolicy
Source§impl PartialEq for CpuBatchPolicy
impl PartialEq for CpuBatchPolicy
impl StructuralPartialEq for CpuBatchPolicy
Auto Trait Implementations§
impl Freeze for CpuBatchPolicy
impl RefUnwindSafe for CpuBatchPolicy
impl Send for CpuBatchPolicy
impl Sync for CpuBatchPolicy
impl Unpin for CpuBatchPolicy
impl UnsafeUnpin for CpuBatchPolicy
impl UnwindSafe for CpuBatchPolicy
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
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