pub struct SimpleButtonState {
pub hovered: Option<String>,
pub pressed: Option<String>,
pub focused: Option<String>,
}Expand description
Simple implementation of ButtonState for prototyping
Fields§
§hovered: Option<String>Currently hovered button ID
pressed: Option<String>Currently pressed button ID
focused: Option<String>Currently focused button ID
Implementations§
Trait Implementations§
Source§impl ButtonState for SimpleButtonState
impl ButtonState for SimpleButtonState
Source§fn is_hovered(&self, button_id: &str) -> bool
fn is_hovered(&self, button_id: &str) -> bool
Check if button is currently hovered
Source§fn is_pressed(&self, button_id: &str) -> bool
fn is_pressed(&self, button_id: &str) -> bool
Check if button is currently pressed
Source§fn is_focused(&self, button_id: &str) -> bool
fn is_focused(&self, button_id: &str) -> bool
Check if button is currently focused
Source§fn set_hovered(&mut self, button_id: Option<&str>)
fn set_hovered(&mut self, button_id: Option<&str>)
Set button hover state
Source§fn set_pressed(&mut self, button_id: Option<&str>)
fn set_pressed(&mut self, button_id: Option<&str>)
Set button pressed state
Source§fn set_focused(&mut self, button_id: Option<&str>)
fn set_focused(&mut self, button_id: Option<&str>)
Set button focus state
Source§impl Clone for SimpleButtonState
impl Clone for SimpleButtonState
Source§fn clone(&self) -> SimpleButtonState
fn clone(&self) -> SimpleButtonState
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SimpleButtonState
impl Debug for SimpleButtonState
Source§impl Default for SimpleButtonState
impl Default for SimpleButtonState
Source§fn default() -> SimpleButtonState
fn default() -> SimpleButtonState
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for SimpleButtonState
impl RefUnwindSafe for SimpleButtonState
impl Send for SimpleButtonState
impl Sync for SimpleButtonState
impl Unpin for SimpleButtonState
impl UnsafeUnpin for SimpleButtonState
impl UnwindSafe for SimpleButtonState
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
Mutably borrows from an owned value. Read more