Skip to main content

Setter

Struct Setter 

Source
pub struct Setter { /* private fields */ }
Expand description

A setter for a Style.

A setter describes what will take place when the requirements for a style are met: it sets a property to a value, binds it to a source of values or sets it to the result of a template.

Implementations§

Source§

impl Setter

Source

pub fn empty() -> Rc<Self>

Creates a setter without a property or value.

Source

pub fn new<T: PropertyValue>( property: &'static StyledProperty<T>, value: T, ) -> Rc<Self>

Creates a setter that sets a styled property to a value.

Source

pub fn new_untyped( property: &'static FerroProperty, value: BoxedValue, ) -> Rc<Self>

Creates a setter that sets a property to an untyped value, which must hold exactly the property’s value type.

Source

pub fn new_binding( property: &'static FerroProperty, source: Rc<dyn IObservable<BoxedValue>>, ) -> Rc<Self>

Creates a setter that binds a property to a source of values.

Source

pub fn new_binding_base( property: &'static FerroProperty, binding: Rc<dyn BindingBase>, ) -> Rc<Self>

Creates a setter that binds a property with a binding (a compiled, string-path, template or multi binding).

Source

pub fn new_template( property: &'static FerroProperty, template: Rc<dyn ITemplate>, ) -> Rc<Self>

Creates a setter that sets a property to the object built by a template.

Source

pub fn with_value( property: &'static FerroProperty, value: SetterValue, ) -> Rc<Self>

Creates a setter for a property with the given kind of value.

Source

pub fn property(&self) -> Option<&'static FerroProperty>

The property to set.

Source

pub fn set_property(&self, value: Option<&'static FerroProperty>)

Source

pub fn value(&self) -> Option<SetterValue>

The property value.

Source

pub fn set_value(&self, value: Option<SetterValue>)

Source

pub fn set_setter_value(&self, value: &dyn ISetterValue, boxed: BoxedValue)

Sets a plain value that wants to be notified that it has become a setter value. boxed is the value as it will be set on the property.

Trait Implementations§

Source§

impl Default for Setter

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Display for Setter

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl IAnimationSetter for Setter

Source§

fn property(&self) -> Option<&'static FerroProperty>

The property the setter targets.
Source§

fn set_property(&self, value: Option<&'static FerroProperty>)

Source§

fn value(&self) -> Option<SetterValue>

The value of the setter: a plain value holding exactly the value type of the property, or a source of such values.
Source§

fn set_value(&self, value: Option<SetterValue>)

Source§

fn as_any(&self) -> Option<&dyn 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.
Source§

impl ISetterInstance for Setter

Source§

impl MarkupTyped for Setter

Source§

const MARKUP: &'static MarkupType

The markup metadata of the type.
Source§

impl PartialEq for Setter

Compares by identity (reference equality), as the reference type this mirrors.

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl SetterBase for Setter

Source§

fn as_any(&self) -> Option<&dyn 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.

Auto Trait Implementations§

§

impl !Freeze for Setter

§

impl !RefUnwindSafe for Setter

§

impl !Send for Setter

§

impl !Sync for Setter

§

impl !UnwindSafe for Setter

§

impl Unpin for Setter

§

impl UnsafeUnpin for Setter

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> AnyValue for T
where T: PartialEq + 'static,

Source§

fn any_value_as_any(&self) -> &(dyn Any + 'static)

Source§

fn any_value_eq(&self, other: &(dyn AnyValue + 'static)) -> bool

Source§

fn any_value_type_name(&self) -> &'static str

Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> ClassDefaults for T
where T: ?Sized,

Source§

fn static_constructor()

The static constructor of a type: work done once per thread, after the properties of the type are registered and before its first instance exists (class handlers, affects_render, metadata overrides). Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.