[][src]Struct fui_core::Property

pub struct Property<T> { /* fields omitted */ }

Implementations

impl<T: 'static + Clone + PartialEq> Property<T>[src]

pub fn new<U: Into<T>>(val: U) -> Self[src]

pub fn binded_from(src_property: &Property<T>) -> Self[src]

pub fn binded_c_from<TSrc: 'static + Clone + PartialEq, F: 'static + Fn(TSrc) -> T>(
    src_property: &Property<TSrc>,
    f: F
) -> Self
[src]

pub fn binded_to(dst_property: &mut Property<T>, init_value: T) -> Self[src]

pub fn binded_c_to<TDst: 'static + Clone + PartialEq, F: 'static + Fn(T) -> TDst>(
    dst_property: &mut Property<TDst>,
    f: F,
    init_value: T
) -> Self
[src]

pub fn binded_two_way(other_property: &mut Property<T>) -> Self[src]

pub fn binded_c_two_way<TOther, F1, F2>(
    other_property: &mut Property<TOther>,
    f1: F1,
    f2: F2
) -> Self where
    TOther: 'static + Clone + PartialEq,
    F1: 'static + Fn(TOther) -> T,
    F2: 'static + Fn(T) -> TOther, 
[src]

pub fn set(&mut self, val: T)[src]

pub fn change<F: 'static + Fn(T) -> T>(&mut self, f: F)[src]

pub fn get(&self) -> T[src]

pub fn bind(&mut self, src_property: &Property<T>)[src]

pub fn bind_c<TSrc: 'static + Clone + PartialEq, F: 'static + Fn(TSrc) -> T>(
    &mut self,
    src_property: &Property<TSrc>,
    f: F
)
[src]

pub fn on_changed<F: 'static + Fn(T)>(&self, f: F) -> EventSubscription[src]

Trait Implementations

impl<V, '_> From<&'_ Property<Option<Rc<RefCell<V>>>>> for Box<dyn ObservableCollection<Rc<RefCell<dyn ControlObject>>>> where
    V: 'static + ViewModel + PartialEq
[src]

impl<V, '_> From<&'_ Property<Rc<RefCell<V>>>> for Box<dyn ObservableCollection<Rc<RefCell<dyn ControlObject>>>> where
    V: 'static + ViewModel + PartialEq
[src]

impl<'_> From<&'_ Property<Rc<RefCell<dyn ControlObject + 'static>>>> for Box<dyn ObservableCollection<Rc<RefCell<dyn ControlObject>>>>[src]

impl<T, '_> From<&'_ Property<T>> for Property<T> where
    T: 'static + Clone + PartialEq
[src]

Allows to easily write one-way binding.

Example:

ui! { Control { text_property: &vm.text }}

impl<T, '_> From<&'_ mut Property<T>> for Property<T> where
    T: 'static + Clone + PartialEq
[src]

Allows to easily write two-way bindings.

Example:

ui! { Control { text_property: &mut vm.text }}

impl<TSrc, TDest, F, '_> From<(&'_ Property<TSrc>, F)> for Property<TDest> where
    TSrc: 'static + Clone + PartialEq,
    TDest: 'static + Clone + PartialEq,
    F: 'static + Fn(TSrc) -> TDest, 
[src]

Allows to easily write one-way binding with converter.

Example:

ui! { Control { text_property: (&vm.count, |c| c.to_string()) }}

impl<TSrc, TDest, F1, F2, '_> From<(&'_ mut Property<TSrc>, F1, F2)> for Property<TDest> where
    TSrc: 'static + Clone + PartialEq,
    TDest: 'static + Clone + PartialEq,
    F1: 'static + Fn(TSrc) -> TDest,
    F2: 'static + Fn(TDest) -> TSrc, 
[src]

Allows to easily write two-way binding with converter.

Example:

ui! { Control { text_property: (&mut vm.count, |c| c.to_string(), |c| c.parse().unwrap()) }}

impl<T, U> From<U> for Property<T> where
    T: 'static + Clone + PartialEq,
    U: Into<T> + IntoProperty
[src]

Allows to convert types attributed with IntoProperty to Property.

Cannot do it for all types at once, because then there is a conflict with binding conversions (tuples and properties used as source).

Example:

ui! { Control { int_property: 10, text_property: "My Text" }}

impl<T> ObservableCollection<T> for Property<T> where
    T: 'static + Clone + PartialEq
[src]

ObservableCollection for Property.

impl<T> ObservableCollection<T> for Property<Option<T>> where
    T: 'static + Clone + PartialEq
[src]

impl<T> PropertyDirtyExtension for Property<T> where
    T: 'static + Clone + PartialEq
[src]

Auto Trait Implementations

impl<T> !RefUnwindSafe for Property<T>

impl<T> !Send for Property<T>

impl<T> !Sync for Property<T>

impl<T> Unpin for Property<T>

impl<T> !UnwindSafe for Property<T>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> UnsafeAny for T where
    T: Any