pub trait Hideable {
// Required methods
fn is_visible(&self) -> bool;
fn visible_mut(&mut self) -> &mut bool;
// Provided methods
fn hide(&mut self) { ... }
fn show(&mut self) { ... }
fn toggle_visibility(&mut self) { ... }
fn set_visibility(&mut self, visible: bool) { ... }
}
Expand description
Interface for hideable UI components.
Required Methods§
sourcefn is_visible(&self) -> bool
fn is_visible(&self) -> bool
Returns whether the component is currently visible.
sourcefn visible_mut(&mut self) -> &mut bool
fn visible_mut(&mut self) -> &mut bool
Returns a mutable reference to the component’s visibility state.
Provided Methods§
sourcefn toggle_visibility(&mut self)
fn toggle_visibility(&mut self)
Toggles the component’s visibility.
sourcefn set_visibility(&mut self, visible: bool)
fn set_visibility(&mut self, visible: bool)
Sets the component’s visibility state.