pub struct CompositionProperty { /* private fields */ }Expand description
The identity of a property of a server-side composition object: what animations, expressions and change notifications refer to.
Properties are registered once per process and are plain data (ids, names and function pointers), so the UI thread and the render thread share them.
Implementations§
Source§impl CompositionProperty
impl CompositionProperty
pub fn id(&self) -> i32
pub fn name(&self) -> &'static str
Sourcepub fn owner(&self) -> TypeId
pub fn owner(&self) -> TypeId
The type that declares the property: the generated property block of the server class.
Sourcepub fn owner_name(&self) -> &'static str
pub fn owner_name(&self) -> &'static str
The name of the server class that declares the property.
Sourcepub fn get_variant(&self) -> Option<fn(&dyn IServerObject) -> ExpressionVariant>
pub fn get_variant(&self) -> Option<fn(&dyn IServerObject) -> ExpressionVariant>
Reads the property of an object as an expression variant; None for
a property whose type has no variant form.
Sourcepub fn set_variant(&self) -> Option<fn(&dyn IServerObject, ExpressionVariant)>
pub fn set_variant(&self) -> Option<fn(&dyn IServerObject, ExpressionVariant)>
Stores an expression variant into the field of the property, without
any notification; None for a property that cannot be animated.
This is the type-erased form of set_field an animation uses to
write the value it evaluated.
Sourcepub fn register<TOwner: Any, TField>(
name: &'static str,
owner_name: &'static str,
get_field: fn(&dyn IServerObject) -> TField,
set_field: fn(&dyn IServerObject, TField),
get_variant: Option<fn(&dyn IServerObject) -> ExpressionVariant>,
set_variant: Option<fn(&dyn IServerObject, ExpressionVariant)>,
) -> CompositionPropertyOf<TField>
pub fn register<TOwner: Any, TField>( name: &'static str, owner_name: &'static str, get_field: fn(&dyn IServerObject) -> TField, set_field: fn(&dyn IServerObject, TField), get_variant: Option<fn(&dyn IServerObject) -> ExpressionVariant>, set_variant: Option<fn(&dyn IServerObject, ExpressionVariant)>, ) -> CompositionPropertyOf<TField>
Registers a property of the server class whose generated property
block is TOwner.
Trait Implementations§
Source§impl Debug for CompositionProperty
impl Debug for CompositionProperty
impl Eq for CompositionProperty
Source§impl Hash for CompositionProperty
impl Hash for CompositionProperty
Auto Trait Implementations§
impl Freeze for CompositionProperty
impl RefUnwindSafe for CompositionProperty
impl Send for CompositionProperty
impl Sync for CompositionProperty
impl Unpin for CompositionProperty
impl UnsafeUnpin for CompositionProperty
impl UnwindSafe for CompositionProperty
Blanket Implementations§
Source§impl<T> AnyValue for Twhere
T: PartialEq + 'static,
impl<T> AnyValue for Twhere
T: PartialEq + 'static,
fn any_value_as_any(&self) -> &(dyn Any + 'static)
fn any_value_eq(&self, other: &(dyn AnyValue + 'static)) -> bool
fn any_value_type_name(&self) -> &'static str
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
Source§impl<T> ClassDefaults for Twhere
T: ?Sized,
impl<T> ClassDefaults for Twhere
T: ?Sized,
Source§fn static_constructor()
fn static_constructor()
affects_render, metadata
overrides). Read more