IPropertyInfo
trait · ferroui-base · v0.5.0
trait IPropertyInfo
Describes a property of an object that is not a registered property: its name, type and untyped accessors.
Members
namegettry_getsetcan_setcan_getproperty_typeas_anyget_boxedtry_get_boxedset_boxedas_ferro_property
name
fn name(self: &Self) -> &str
The name of the property.
get
fn get(self: &Self, target: &dyn AnyValue) -> Option<BoxedValue>
Reads the property from target. Null is None.
try_get
fn try_get(self: &Self, target: &dyn AnyValue) -> Result<Option<BoxedValue>, BindingError>
Reads the property from target. An Err is the equivalent of the
getter throwing, for example because target is not of the type that
declares the property.
set
fn set(self: &Self, target: &dyn AnyValue, value: Option<&BoxedValue>) -> Result<(), BindingError>
Writes the property on target. An Err is the equivalent of the
setter throwing.
can_set
fn can_set(self: &Self) -> bool
can_get
fn can_get(self: &Self) -> bool
property_type
fn property_type(self: &Self) -> ValueType
The type of the property's value.
as_any
fn as_any(self: &Self) -> Option<&dyn std::any::Any>
The implementing value, for casting to its concrete type
(as_any()?.downcast_ref::<T>()): the equivalent of is/as on the
contract. None for an implementation that does not expose itself.
get_boxed
fn get_boxed(self: &Self, target: &BoxedValue) -> Option<BoxedValue>
get for an owner known as an untyped handle. The
accessors of binding paths read through the boxed forms, so that a
property description whose accessors need the handle of the owner
(not only a view of it) can override them; the defaults forward to
the forms taking a view. Override the three boxed forms together.
try_get_boxed
fn try_get_boxed(self: &Self, target: &BoxedValue) -> Result<Option<BoxedValue>, BindingError>
try_get for an owner known as an untyped handle.
set_boxed
fn set_boxed(self: &Self, target: &BoxedValue, value: Option<&BoxedValue>) -> Result<(), BindingError>
set for an owner known as an untyped handle.
as_ferro_property
fn as_ferro_property(self: &Self) -> Option<&'static FerroProperty>
The registered property this description is, if it is one (the cast of a property description back to the registered property class).
Trait implementations
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.