[−][src]Struct fui_core::Property
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]
src_property: &Property<TSrc>,
f: F
) -> Self
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]
dst_property: &mut Property<TDst>,
f: F,
init_value: T
) -> Self
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]
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,
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]
&mut self,
src_property: &Property<TSrc>,
f: F
)
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]
V: 'static + ViewModel + PartialEq,
impl<V, '_> From<&'_ Property<Rc<RefCell<V>>>> for Box<dyn ObservableCollection<Rc<RefCell<dyn ControlObject>>>> where
V: 'static + ViewModel + PartialEq,
[src]
V: 'static + ViewModel + PartialEq,
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]
T: 'static + Clone + PartialEq,
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]
T: 'static + Clone + PartialEq,
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]
TSrc: 'static + Clone + PartialEq,
TDest: 'static + Clone + PartialEq,
F: 'static + Fn(TSrc) -> TDest,
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]
TSrc: 'static + Clone + PartialEq,
TDest: 'static + Clone + PartialEq,
F1: 'static + Fn(TSrc) -> TDest,
F2: 'static + Fn(TDest) -> TSrc,
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]
T: 'static + Clone + PartialEq,
U: Into<T> + IntoProperty,
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]
T: 'static + Clone + PartialEq,
ObservableCollection for Property.
fn len(&self) -> usize
[src]
fn get(&self, _index: usize) -> T
[src]
fn on_changed(
&self,
f: Box<dyn Fn(ObservableChangedEventArgs<T>)>
) -> Option<EventSubscription>
[src]
&self,
f: Box<dyn Fn(ObservableChangedEventArgs<T>)>
) -> Option<EventSubscription>
impl<T> ObservableCollection<T> for Property<Option<T>> where
T: 'static + Clone + PartialEq,
[src]
T: 'static + Clone + PartialEq,
fn len(&self) -> usize
[src]
fn get(&self, _index: usize) -> T
[src]
fn on_changed(
&self,
f: Box<dyn Fn(ObservableChangedEventArgs<T>)>
) -> Option<EventSubscription>
[src]
&self,
f: Box<dyn Fn(ObservableChangedEventArgs<T>)>
) -> Option<EventSubscription>
impl<T> PropertyDirtyExtension for Property<T> where
T: 'static + Clone + PartialEq,
[src]
T: 'static + Clone + PartialEq,
fn dirty_watching(
&self,
control: &Rc<RefCell<dyn ControlObject>>
) -> EventSubscription
[src]
&self,
control: &Rc<RefCell<dyn ControlObject>>
) -> EventSubscription
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> UnsafeAny for T where
T: Any,
T: Any,