pub enum PaxValue {
Show 14 variants
Bool(bool),
Numeric(Numeric),
String(String),
Size(Size),
Percent(Percent),
Color(Box<Color>),
Rotation(Rotation),
Duration(Duration),
PathElement(Box<PathElement>),
Option(Box<Option<PaxValue>>),
Vec(Vec<PaxValue>),
Range(Box<PaxValue>, Box<PaxValue>),
Object(Vec<(String, PaxValue)>),
Enum(Box<(String, String, Vec<PaxValue>)>),
}Expand description
Runtime container for polymorphic values, for evaluating PAXEL.
Two important traits are related to this type: ToFromPaxValue - responsible for converting to and from specific types (u8, String, Color, etc) CoercionRules - responsible for coercing a PaxValue to a specific type (possibly from multiple different variants)
Variants§
Bool(bool)
Boolean value.
Numeric(Numeric)
Polymorphic numeric value.
String(String)
UTF-8 string value.
Size(Size)
Pax size value, such as 25px or 50%.
Percent(Percent)
Raw percent value.
Color(Box<Color>)
Pax color value.
Rotation(Rotation)
Pax rotation value.
Duration(Duration)
Pax animation duration value, such as 250ms, 1s, or 10f.
PathElement(Box<PathElement>)
Vector path element value.
Option(Box<Option<PaxValue>>)
Optional value.
Vec(Vec<PaxValue>)
Homogeneous or heterogeneous vector value.
Range(Box<PaxValue>, Box<PaxValue>)
Range value.
Object(Vec<(String, PaxValue)>)
Object value represented by named fields.
Enum(Box<(String, String, Vec<PaxValue>)>)
Enum value represented by type name, variant name, and payload values.
Implementations§
Trait Implementations§
Source§impl CoercionRules for PaxValue
impl CoercionRules for PaxValue
Source§fn is_identity_roundtrip() -> bool
fn is_identity_roundtrip() -> bool
Whether cloning
Self preserves the semantics of converting that clone
through ToPaxValue and back with try_coerce. Read moreSource§fn try_coerce(value: PaxValue) -> Result<PaxValue, String>
fn try_coerce(value: PaxValue) -> Result<PaxValue, String>
Attempts to coerce
value into Self.Source§fn allows_singleton_stack() -> bool
fn allows_singleton_stack() -> bool
Opts appearance layers into scalar-to-singleton stack conversion.
Ordinary vector values remain list-only.
Source§impl<'de> Deserialize<'de> for PaxValue
impl<'de> Deserialize<'de> for PaxValue
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<PaxValue, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<PaxValue, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl HelperFunctions for PaxValue
impl HelperFunctions for PaxValue
Source§fn register_all_functions()
fn register_all_functions()
Registers all helper functions for this type.
Source§impl Interpolatable for PaxValue
impl Interpolatable for PaxValue
Source§fn interpolate(&self, _other: &Self, _t: f64) -> Self
fn interpolate(&self, _other: &Self, _t: f64) -> Self
Source§impl PartialOrd for PaxValue
impl PartialOrd for PaxValue
Source§impl Serialize for PaxValue
impl Serialize for PaxValue
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl StructuralPartialEq for PaxValue
Source§impl ToFromPaxAny for PaxValue
impl ToFromPaxAny for PaxValue
Source§fn to_pax_any(self) -> PaxAny
fn to_pax_any(self) -> PaxAny
Converts this value into a
PaxAny.Source§fn from_pax_any(pax_any: PaxAny) -> Result<PaxValue, String>
fn from_pax_any(pax_any: PaxAny) -> Result<PaxValue, String>
Attempts to recover this concrete type from a
PaxAny.Source§impl ToPaxValue for PaxValue
impl ToPaxValue for PaxValue
Source§fn to_pax_value(self) -> PaxValue
fn to_pax_value(self) -> PaxValue
Converts this value into a
PaxValue.Source§fn nested_properties(&self) -> Vec<UntypedProperty>
fn nested_properties(&self) -> Vec<UntypedProperty>
Live properties read when snapshotting a compound value for PAXEL.
Adapters observe these as well as the containing property.
Source§fn to_pax_value_in_graph(self) -> PaxValuewhere
Self: Sized,
fn to_pax_value_in_graph(self) -> PaxValuewhere
Self: Sized,
Converts against owner-thread graph views, including nested generated
property fields. Requires an entered property graph for shared fields.
Ordinary
Self::to_pax_value reads published value snapshots.Auto Trait Implementations§
impl Freeze for PaxValue
impl RefUnwindSafe for PaxValue
impl Send for PaxValue
impl Sync for PaxValue
impl Unpin for PaxValue
impl UnsafeUnpin for PaxValue
impl UnwindSafe for PaxValue
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>,
impl<T, Rhs, Output> NumOps<Rhs, Output> for T
impl<T> PropertyValue for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T, U> RoundInto<U> for Twhere
U: RoundFrom<T>,
impl<T, U> RoundInto<U> for Twhere
U: RoundFrom<T>,
Source§fn round_into(self) -> U
fn round_into(self) -> U
Performs the conversion.