pub struct ResolvedPlanningConfig { /* private fields */ }Expand description
Fully resolved planning configuration.
§Examples
use tenferro_runtime::{
Determinism, ExecutionPolicy, HardwareClassId, PrepareOptions, ResolvedPlanningConfig,
};
let policy = ExecutionPolicy::new(Determinism::Fast, Some(32), 5);
let config = ResolvedPlanningConfig::resolve(
&policy,
&PrepareOptions::new(),
HardwareClassId::new("tenferro.cpu")?,
);
assert_eq!(config.hard_workspace_limit_bytes(), Some(32));Implementations§
Source§impl ResolvedPlanningConfig
impl ResolvedPlanningConfig
Sourcepub fn resolve(
policy: &ExecutionPolicy,
options: &PrepareOptions,
hardware_class: HardwareClassId,
) -> Self
pub fn resolve( policy: &ExecutionPolicy, options: &PrepareOptions, hardware_class: HardwareClassId, ) -> Self
Resolve raw policy and per-call options into concrete planning config.
§Examples
use tenferro_runtime::{
Determinism, ExecutionPolicy, HardwareClassId, PrepareOptions, ResolvedPlanningConfig,
};
let policy = ExecutionPolicy::new(Determinism::Fast, Some(32), 5);
let options = PrepareOptions::new().with_hard_workspace_limit_bytes(Some(0));
let config = ResolvedPlanningConfig::resolve(
&policy,
&options,
HardwareClassId::new("tenferro.cpu")?,
);
assert_eq!(config.hard_workspace_limit_bytes(), Some(0));Sourcepub fn determinism(&self) -> Determinism
pub fn determinism(&self) -> Determinism
Return the resolved determinism mode.
§Examples
use tenferro_runtime::{
Determinism, ExecutionPolicy, HardwareClassId, PrepareOptions, ResolvedPlanningConfig,
};
let config = ResolvedPlanningConfig::resolve(
&ExecutionPolicy::new(Determinism::Reproducible, None, 0),
&PrepareOptions::new(),
HardwareClassId::new("tenferro.cpu")?,
);
assert_eq!(config.determinism(), Determinism::Reproducible);Sourcepub fn hard_workspace_limit_bytes(&self) -> Option<usize>
pub fn hard_workspace_limit_bytes(&self) -> Option<usize>
Return the resolved hard workspace limit.
§Examples
use tenferro_runtime::{
Determinism, ExecutionPolicy, HardwareClassId, PrepareOptions, ResolvedPlanningConfig,
};
let config = ResolvedPlanningConfig::resolve(
&ExecutionPolicy::new(Determinism::Fast, Some(7), 0),
&PrepareOptions::new(),
HardwareClassId::new("tenferro.cpu")?,
);
assert_eq!(config.hard_workspace_limit_bytes(), Some(7));Sourcepub fn planning_seed(&self) -> u64
pub fn planning_seed(&self) -> u64
Return the resolved planning seed.
§Examples
use tenferro_runtime::{
Determinism, ExecutionPolicy, HardwareClassId, PrepareOptions, ResolvedPlanningConfig,
};
let config = ResolvedPlanningConfig::resolve(
&ExecutionPolicy::new(Determinism::Fast, None, 19),
&PrepareOptions::new(),
HardwareClassId::new("tenferro.cpu")?,
);
assert_eq!(config.planning_seed(), 19);Sourcepub fn hardware_class(&self) -> &HardwareClassId
pub fn hardware_class(&self) -> &HardwareClassId
Return the resolved hardware class.
§Examples
use tenferro_runtime::{
Determinism, ExecutionPolicy, HardwareClassId, PrepareOptions, ResolvedPlanningConfig,
};
let hardware = HardwareClassId::new("tenferro.cpu")?;
let config = ResolvedPlanningConfig::resolve(
&ExecutionPolicy::new(Determinism::Fast, None, 0),
&PrepareOptions::new(),
hardware.clone(),
);
assert_eq!(config.hardware_class(), &hardware);Trait Implementations§
Source§impl Clone for ResolvedPlanningConfig
impl Clone for ResolvedPlanningConfig
Source§fn clone(&self) -> ResolvedPlanningConfig
fn clone(&self) -> ResolvedPlanningConfig
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 ResolvedPlanningConfig
impl Debug for ResolvedPlanningConfig
Source§impl Hash for ResolvedPlanningConfig
impl Hash for ResolvedPlanningConfig
Source§impl PartialEq for ResolvedPlanningConfig
impl PartialEq for ResolvedPlanningConfig
Source§fn eq(&self, other: &ResolvedPlanningConfig) -> bool
fn eq(&self, other: &ResolvedPlanningConfig) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Eq for ResolvedPlanningConfig
impl StructuralPartialEq for ResolvedPlanningConfig
Auto Trait Implementations§
impl Freeze for ResolvedPlanningConfig
impl RefUnwindSafe for ResolvedPlanningConfig
impl Send for ResolvedPlanningConfig
impl Sync for ResolvedPlanningConfig
impl Unpin for ResolvedPlanningConfig
impl UnsafeUnpin for ResolvedPlanningConfig
impl UnwindSafe for ResolvedPlanningConfig
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,
§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
Compare self to
key and return true if they are equal.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