Enum rg3d_ui::message::MessageDirection[][src]

pub enum MessageDirection {
    ToWidget,
    FromWidget,
}

Message direction allows you to distinguish from where message has came from. Often there is a need to find out who created a message to respond properly. Imagine that we have a NumericUpDown input field for a property and we using some data source to feed data into input field. When we change something in the input field by typing, it creates a message with new value. On other hand we often need to put new value in the input field from some code, in this case we again creating a message. But how to understand from which “side” message has came from? Was it filled in by user and we should create a command to change value in the data source, or it was created from syncing code just to pass new value to UI? This problem solved by setting a direction to a message. Also it solves another problem: often we need to respond to a message only if it did some changes. In this case at first we fire a message with ToWidget direction, widget catches it and checks if changes are needed and if so, it “rethrows” message with direction FromWidget. Listeners are “subscribed” to FromWidget messages only and won’t respond to ToWidget messages.

Variants

ToWidget

Used to indicate a request for changes in a widget.

FromWidget

Used to indicate response from widget if anything has actually changed.

Implementations

impl MessageDirection[src]

pub fn reverse(self) -> Self[src]

Reverses direction.

Trait Implementations

impl Clone for MessageDirection[src]

impl Copy for MessageDirection[src]

impl Debug for MessageDirection[src]

impl Hash for MessageDirection[src]

impl PartialEq<MessageDirection> for MessageDirection[src]

impl PartialOrd<MessageDirection> for MessageDirection[src]

impl StructuralPartialEq for MessageDirection[src]

Auto Trait Implementations

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> Pointable for T

type Init = T

The type for initializers.

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> Scalar for T where
    T: Copy + PartialEq<T> + Debug + Any
[src]

impl<SS, SP> SupersetOf<SS> for SP where
    SS: SubsetOf<SP>, 

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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