[][src]Struct uniui_gui::prelude::Property

pub struct Property<T> where
    T: 'static + Clone
{ /* fields omitted */ }

Property represents a storage which may receive new values via it's slot and may notify about value change via it's signal.

It's important that Property::try_update method have to be called to initiate slot data processing.

Implementations

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

pub fn new(value: T) -> Property<T>[src]

Creates new property instance.

pub fn signal(&mut self) -> &mut Signal<T>[src]

Signal will be emited at least every time inner value will be changed

It's possible that signal may be emited with the same value.

pub fn slot(&self) -> &dyn Slot<T>[src]

The slot allows value change to be scheduled.

The value will not be changed without (Property::try_update) call. Only after that the value will be update and signal will be emited.

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

Sets new value. Signal will be emited to inform about value change.

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

Allow access to property's value via immutable ref

pub fn for_mut(&mut self, f: &dyn Fn(&mut T))[src]

Allow function to be change inner value. Signal will be rased to inform about value change even if value is the same.

pub fn try_update(&mut self) -> bool[src]

Initiates inner value update from slot's data. Signal will be emited for every incoming slot data.

return true if there was at least one update from slot, otherwise return false

Trait Implementations

impl<T> Default for Property<T> where
    T: 'static + Clone + Default
[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> where
    T: Unpin

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<V, T> VZip<V> for T where
    V: MultiLane<T>,