Struct CpuBatchPolicy
pub struct CpuBatchPolicy {
pub strategy: BatchStrategy,
pub model: WorkModel,
}Expand description
A batch strategy together with the CpuBatchThresholds Auto applies.
This is tcontract_exec::BatchPolicy.
§Examples
use tenferro_cpu::{CpuBatchPolicy, CpuBatchStrategy};
let policy = CpuBatchPolicy::new(CpuBatchStrategy::Outer);
assert_eq!(policy.strategy, CpuBatchStrategy::Outer);A strategy and the model its Auto arm applies.
§Examples
use tcontract_exec::batch::{BatchPolicy, BatchStrategy};
assert_eq!(BatchPolicy::default().strategy, BatchStrategy::Auto);Fields§
§strategy: BatchStrategyThe route selector.
model: WorkModelThe cost model Auto applies.
Implementations§
§impl BatchPolicy
impl BatchPolicy
pub fn new(strategy: BatchStrategy) -> BatchPolicy
pub fn new(strategy: BatchStrategy) -> BatchPolicy
A policy with strategy and the default model.
pub fn with_strategy(self, strategy: BatchStrategy) -> BatchPolicy
pub fn with_strategy(self, strategy: BatchStrategy) -> BatchPolicy
Return this policy with a different strategy.
pub fn with_model(self, model: WorkModel) -> BatchPolicy
pub fn with_model(self, model: WorkModel) -> BatchPolicy
Return this policy with a different model.
Trait Implementations§
§impl Clone for BatchPolicy
impl Clone for BatchPolicy
§fn clone(&self) -> BatchPolicy
fn clone(&self) -> BatchPolicy
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 BatchPolicy
§impl Debug for BatchPolicy
impl Debug for BatchPolicy
§impl Default for BatchPolicy
impl Default for BatchPolicy
§fn default() -> BatchPolicy
fn default() -> BatchPolicy
Returns the “default value” for a type. Read more
§impl PartialEq for BatchPolicy
impl PartialEq for BatchPolicy
impl StructuralPartialEq for BatchPolicy
Auto Trait Implementations§
impl Freeze for BatchPolicy
impl RefUnwindSafe for BatchPolicy
impl Send for BatchPolicy
impl Sync for BatchPolicy
impl Unpin for BatchPolicy
impl UnsafeUnpin for BatchPolicy
impl UnwindSafe for BatchPolicy
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