CompositionPropertySet
struct · ferroui-base · v0.5.0
struct CompositionPropertySet
Property sets are composition objects that allow storage of key values pairs that can be shared across the application and are not tied to the lifetime of another composition object. Property sets are most commonly used with animations, where they maintain key-value pairs that are referenced to drive portions of composition animations. Property sets provide the ability to insert key-value pairs or retrieve a value for a given key. A property set does not support a delete function – ensure you use property sets to store values that will be shared across the application.
A property set made with new (or Compositor::create_property_set) is live,
as in WinUI: it has a server counterpart that receives its entries with each batch, its
entries can be animated with start_animation, and an expression that refers to it reads
its current values. Upstream's property sets live on the UI thread only, and an expression
sees a copy of them taken when its animation starts; the parameters of an animation are such
a set (see docs/porting/winui-composition.md).
Members
newis_livecompositorinsert_colorinsert_matrix3x2insert_matrix4x4insert_quaternioninsert_scalarinsert_vector2insert_vector3insert_vector4try_get_colortry_get_matrix3x2try_get_matrix4x4try_get_quaterniontry_get_scalartry_get_vector2try_get_vector3try_get_vector4insert_booleantry_get_boolean
new
fn new(compositor: &Rc<Compositor>) -> Rc<CompositionPropertySet>
Creates a live property set (Compositor.CreatePropertySet).
is_live
fn is_live(self: &Self) -> bool
Whether the set is live (has a server counterpart).
compositor
fn compositor(self: &Self) -> &Rc<Compositor>
insert_color
fn insert_color(self: &Self, property_name: &str, value: Color)
insert_matrix3x2
fn insert_matrix3x2(self: &Self, property_name: &str, value: Matrix3x2)
insert_matrix4x4
fn insert_matrix4x4(self: &Self, property_name: &str, value: Matrix4x4)
insert_quaternion
fn insert_quaternion(self: &Self, property_name: &str, value: Quaternion)
insert_scalar
fn insert_scalar(self: &Self, property_name: &str, value: f32)
insert_vector2
fn insert_vector2(self: &Self, property_name: &str, value: Vector2)
insert_vector3
fn insert_vector3(self: &Self, property_name: &str, value: Vector3)
insert_vector4
fn insert_vector4(self: &Self, property_name: &str, value: Vector4)
try_get_color
fn try_get_color(self: &Self, property_name: &str) -> (CompositionGetValueStatus, Color)
try_get_matrix3x2
fn try_get_matrix3x2(self: &Self, property_name: &str) -> (CompositionGetValueStatus, Matrix3x2)
try_get_matrix4x4
fn try_get_matrix4x4(self: &Self, property_name: &str) -> (CompositionGetValueStatus, Matrix4x4)
try_get_quaternion
fn try_get_quaternion(self: &Self, property_name: &str) -> (CompositionGetValueStatus, Quaternion)
try_get_scalar
fn try_get_scalar(self: &Self, property_name: &str) -> (CompositionGetValueStatus, f32)
try_get_vector2
fn try_get_vector2(self: &Self, property_name: &str) -> (CompositionGetValueStatus, Vector2)
try_get_vector3
fn try_get_vector3(self: &Self, property_name: &str) -> (CompositionGetValueStatus, Vector3)
try_get_vector4
fn try_get_vector4(self: &Self, property_name: &str) -> (CompositionGetValueStatus, Vector4)
insert_boolean
fn insert_boolean(self: &Self, property_name: &str, value: bool)
try_get_boolean
fn try_get_boolean(self: &Self, property_name: &str) -> (CompositionGetValueStatus, bool)
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafeClassDefaultsBorrow<T>BorrowMut<T>Into<U>From<T>TryInto<U>TryFrom<U>AnyErasedDestructorIntoEitherAsCompositionObjectICompositorSerializableICompositionObjectAnimations
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.