pub enum UiMessage<T: Copy + Eq + Hash> {
Extern(T),
Clicked(u32),
ClickedRight(u32),
PressedKey(u32),
Triggered(u32),
}
Expand description
A simple enum that specififes what kind of messages a UI element can send or receive.
Variants§
Extern(T)
An extern message, containing another Message of the specified type used by your gamestate. Never sent by elements on their own.
Clicked(u32)
A struct that is sent by an element when it is clicked (using the left mouse button), containing its ID. Elements with ID 0 will not send such messages.
ClickedRight(u32)
A struct that is sent by an element when it is clicked using the right mouse button, containing its ID. Elements with ID 0 will not send such messages.
PressedKey(u32)
A struct that is sent by an element when one of its registered keys are pressed, containing its ID. Elements with ID 0 will not send such messages.
Triggered(u32)
A struct that is sent if an element is ‘triggered’ in any way (key press or click) in addition to the specific event as above
Trait Implementations§
source§impl<T: PartialEq + Copy + Eq + Hash> PartialEq<UiMessage<T>> for UiMessage<T>
impl<T: PartialEq + Copy + Eq + Hash> PartialEq<UiMessage<T>> for UiMessage<T>
impl<T: Copy + Copy + Eq + Hash> Copy for UiMessage<T>
impl<T: Eq + Copy + Eq + Hash> Eq for UiMessage<T>
impl<T: Copy + Eq + Hash> StructuralEq for UiMessage<T>
impl<T: Copy + Eq + Hash> StructuralPartialEq for UiMessage<T>
Auto Trait Implementations§
impl<T> RefUnwindSafe for UiMessage<T>where T: RefUnwindSafe,
impl<T> Send for UiMessage<T>where T: Send,
impl<T> Sync for UiMessage<T>where T: Sync,
impl<T> Unpin for UiMessage<T>where T: Unpin,
impl<T> UnwindSafe for UiMessage<T>where T: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.