pub struct BatchPolicy {
pub strategy: BatchStrategy,
pub model: WorkModel,
}Expand description
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§
Source§impl BatchPolicy
impl BatchPolicy
Sourcepub fn new(strategy: BatchStrategy) -> Self
pub fn new(strategy: BatchStrategy) -> Self
A policy with strategy and the default model.
Sourcepub fn with_strategy(self, strategy: BatchStrategy) -> Self
pub fn with_strategy(self, strategy: BatchStrategy) -> Self
Return this policy with a different strategy.
Sourcepub fn with_model(self, model: WorkModel) -> Self
pub fn with_model(self, model: WorkModel) -> Self
Return this policy with a different model.
Trait Implementations§
Source§impl Clone for BatchPolicy
impl Clone for BatchPolicy
impl Copy for BatchPolicy
Source§impl Debug for BatchPolicy
impl Debug for BatchPolicy
Source§impl Default for BatchPolicy
impl Default for BatchPolicy
Source§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