pub enum VariableMapTransform {
Named(String),
Expression(ExpressionNode),
}Expand description
A variable_map coupling transform (esm-spec §10.4): either one of the
NAMED transform strings ("param_to_var", "identity",
"additive", "multiplicative", "conversion_factor") or an Expression
evaluated on the source value(s) in the flattened coupled system’s scope
(the regridding form).
On the wire an Expression transform is always an operator-node OBJECT: the
degenerate bare-reference and literal Expression spellings are not
admissible (the named string transforms already cover bare replacement,
and the string space is reserved for them), so a JSON string deserializes
to VariableMapTransform::Named, an object to
VariableMapTransform::Expression, and a bare number is rejected.
Variants§
Named(String)
Legacy named transform string.
Expression(ExpressionNode)
Expression transform: an operator node whose variable references are
fully scoped and which MUST reference the entry’s from variable
(esm-spec §10.4). Template invocations inside it are expanded at load.
Implementations§
Source§impl VariableMapTransform
impl VariableMapTransform
Sourcepub fn as_named(&self) -> Option<&str>
pub fn as_named(&self) -> Option<&str>
The named transform string, if this is the legacy string form.
Sourcepub fn as_expression(&self) -> Option<&ExpressionNode>
pub fn as_expression(&self) -> Option<&ExpressionNode>
The Expression operator node, if this is the expression form.
Sourcepub fn is_expression(&self) -> bool
pub fn is_expression(&self) -> bool
Whether this is the expression form.
Trait Implementations§
Source§impl Clone for VariableMapTransform
impl Clone for VariableMapTransform
Source§impl Debug for VariableMapTransform
impl Debug for VariableMapTransform
Source§impl<'de> Deserialize<'de> for VariableMapTransform
impl<'de> Deserialize<'de> for VariableMapTransform
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Display for VariableMapTransform
impl Display for VariableMapTransform
Source§impl PartialEq for VariableMapTransform
impl PartialEq for VariableMapTransform
Source§impl Serialize for VariableMapTransform
impl Serialize for VariableMapTransform
impl StructuralPartialEq for VariableMapTransform
Auto Trait Implementations§
impl Freeze for VariableMapTransform
impl RefUnwindSafe for VariableMapTransform
impl Send for VariableMapTransform
impl Sync for VariableMapTransform
impl Unpin for VariableMapTransform
impl UnsafeUnpin for VariableMapTransform
impl UnwindSafe for VariableMapTransform
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> DistributionExt for Twhere
T: ?Sized,
impl<T> DistributionExt for Twhere
T: ?Sized,
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> ⓘ
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> ⓘ
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
impl<T> Scalar for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.