pub struct TiedPlan {
pub order: Vec<TiedParam>,
}Expand description
A dependency-ordered plan for evaluating tied parameters.
order lists TiedParams such that every target appears after all of
the tied targets it (transitively) references. Evaluating the plan in
order therefore guarantees each reference resolves to an already-updated
value.
Fields§
§order: Vec<TiedParam>Tied assignments in dependency (topological) order.
Implementations§
Source§impl TiedPlan
impl TiedPlan
Sourcepub fn build<'a, I>(edges: I) -> Result<Self, CoreError>
pub fn build<'a, I>(edges: I) -> Result<Self, CoreError>
Build a dependency-ordered plan from (target, expression_src) pairs.
Performs a topological sort over the tied-target dependency graph and
detects cycles (e.g. a → b → a).
§Errors
CoreError::Evalif an expression fails to parse.CoreError::Evalif a target is assigned more than once.CoreError::Evalif a dependency cycle is detected.
Sourcepub fn apply(&self, values: &mut HashMap<String, f64>) -> Result<(), CoreError>
pub fn apply(&self, values: &mut HashMap<String, f64>) -> Result<(), CoreError>
Apply the plan in dependency order, mutating values in place so that
each tied target is set to its evaluated expression.
§Errors
Returns CoreError::Eval if any expression references a key that is
not yet present in values.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TiedPlan
impl RefUnwindSafe for TiedPlan
impl Send for TiedPlan
impl Sync for TiedPlan
impl Unpin for TiedPlan
impl UnsafeUnpin for TiedPlan
impl UnwindSafe for TiedPlan
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,
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§impl<T> Pointable for T
impl<T> Pointable for T
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.