pub enum OptsPatch {
Typed(TypedOptsPatch),
ForTypes(ForTypesPatch),
Universal(MolOpts),
}Expand description
One cascade rule. Untagged order: typed → for_types → universal.
Variants§
Typed(TypedOptsPatch)
{ "type": "mol", "weight": 1.2 } — discriminated kind.
ForTypes(ForTypesPatch)
{ "for_types": ["mol","group"], "color": "#111" }.
Universal(MolOpts)
{ "color": "#111", "weight": 1.2 } — applies to every kind (MolOpts).
Universal is MolOpts (not CommonOpts) so container bags can stamp
mol-only keys without wrapping { "type": "mol", … }.
Implementations§
Source§impl OptsPatch
impl OptsPatch
Sourcepub fn applies_to(&self, target: NodeType) -> bool
pub fn applies_to(&self, target: NodeType) -> bool
Whether this patch applies when resolving for target.
pub fn apply_to_mol(&self, out: &mut MolOpts)
Trait Implementations§
Source§impl<'de> Deserialize<'de> for OptsPatch
impl<'de> Deserialize<'de> for OptsPatch
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>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for OptsPatch
Auto Trait Implementations§
impl Freeze for OptsPatch
impl RefUnwindSafe for OptsPatch
impl Send for OptsPatch
impl Sync for OptsPatch
impl Unpin for OptsPatch
impl UnsafeUnpin for OptsPatch
impl UnwindSafe for OptsPatch
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
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> 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