Skip to main content

StyledPropertyOptions

Struct StyledPropertyOptions 

Source
pub struct StyledPropertyOptions<T> { /* private fields */ }
Expand description

Options for registering a styled or attached property.

Implementations§

Source§

impl<T: PropertyValue> StyledPropertyOptions<T>

Source

pub fn new(default_value: T) -> Self

Source

pub fn inherits(self, inherits: bool) -> Self

Whether the property inherits its value from the parent object.

Source

pub fn default_binding_mode(self, mode: BindingMode) -> Self

The default binding mode for the property.

Source

pub fn validate(self, validate: impl Fn(&T) -> bool + 'static) -> Self

A value validation callback. Setting a value for which it returns false is rejected.

Source

pub fn coerce(self, coerce: impl Fn(&FerroObject, T) -> T + 'static) -> Self

A value coercion callback.

Source

pub fn enable_data_validation(self, enable: bool) -> Self

Whether the property is interested in data validation.

Source

pub fn assign_binding(self, assign_binding: bool) -> Self

Whether a binding given for the property in markup is assigned to the property instead of bound to it; see FerroProperty::assign_binding.

Source

pub fn notifying(self, notifying: impl Fn(&FerroObject, bool) + 'static) -> Self

A callback invoked before and after change notifications are raised.

Auto Trait Implementations§

§

impl<T> !RefUnwindSafe for StyledPropertyOptions<T>

§

impl<T> !Send for StyledPropertyOptions<T>

§

impl<T> !Sync for StyledPropertyOptions<T>

§

impl<T> !UnwindSafe for StyledPropertyOptions<T>

§

impl<T> Freeze for StyledPropertyOptions<T>
where T: Freeze, Option<Box<dyn Fn(&T) -> bool>>: Freeze, Option<Rc<dyn Fn(&FerroObject, T) -> T>>: Freeze,

§

impl<T> Unpin for StyledPropertyOptions<T>
where T: Unpin, Option<Box<dyn Fn(&T) -> bool>>: Unpin, Option<Rc<dyn Fn(&FerroObject, T) -> T>>: Unpin,

§

impl<T> UnsafeUnpin for StyledPropertyOptions<T>
where T: UnsafeUnpin, Option<Box<dyn Fn(&T) -> bool>>: UnsafeUnpin, Option<Rc<dyn Fn(&FerroObject, T) -> T>>: UnsafeUnpin,

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> 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, 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.