pub enum PropKey {
CompKey(CompKey),
FpdKey(FpdKey),
}Expand description
Keys for accessing specific property values from MixProperties via MixProperties::get()
This enum wraps both CompKey and FpdKey to allow accessing all properties from a single
interface, which is helpful in downstream applications, to have a single flattened list of keys.
There are From implementations for both key types to facilitate easy conversion.
§Example
use sci_cream::{CompKey, FpdKey, PropKey, MixProperties};
let mix_props = MixProperties::empty();
assert_eq!(mix_props.get(CompKey::MilkFat.into()), 0.0);
assert_eq!(mix_props.get(FpdKey::FPD.into()), 0.0);Variants§
CompKey(CompKey)
CompKey for Composition properties from MixProperties::composition
FpdKey(FpdKey)
FpdKey for FPD properties from MixProperties::fpd
Trait Implementations§
Source§impl<'de> Deserialize<'de> for PropKey
impl<'de> Deserialize<'de> for PropKey
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
Source§impl KeyAsStrings for PropKey
impl KeyAsStrings for PropKey
Source§fn as_med_str(&self) -> &'static str
fn as_med_str(&self) -> &'static str
Returns a medium verbosity string representation of the key.
impl Copy for PropKey
impl Eq for PropKey
impl StructuralPartialEq for PropKey
Auto Trait Implementations§
impl Freeze for PropKey
impl RefUnwindSafe for PropKey
impl Send for PropKey
impl Sync for PropKey
impl Unpin for PropKey
impl UnsafeUnpin for PropKey
impl UnwindSafe for PropKey
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