Struct minecraft_assets::schemas::blockstates::multipart::Case [−][src]
pub struct Case {
pub when: Option<WhenClause>,
pub apply: Variant,
}
Expand description
Specifies a case and the model that should apply in that case.
Fields
when: Option<WhenClause>
A list of cases that have to be met for the model to be applied.
If unset, the model always applies.
apply: Variant
Specifies the model(s) to apply and its properties.
Implementations
pub fn applies<'a, I>(&self, state_values: I) -> bool where
I: IntoIterator<Item = (&'a str, &'a StateValue)> + Clone,
pub fn applies<'a, I>(&self, state_values: I) -> bool where
I: IntoIterator<Item = (&'a str, &'a StateValue)> + Clone,
Returns true
if the case applies given the provided state values.
This can either be when when
is None
or if
WhenClause::applies
is true.
Trait Implementations
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
Auto Trait Implementations
impl RefUnwindSafe for Case
impl UnwindSafe for Case
Blanket Implementations
Mutably borrows from an owned value. Read more