pub struct VisibilityToggle<E: CanDraw> {
pub element: E,
pub visible: bool,
}
Expand description
VisibilityToggle
is a container for a CanDraw
with a property visible
. When drawn to a Canvas
the contained element will only appear if visible
is true
Fields§
§element: E
The element held by the VisibilityToggle
. Must implement CanDraw
visible: bool
Whether the element is visible
Implementations§
Trait Implementations§
Source§impl<E: CanDraw + CanCollide> CanCollide for VisibilityToggle<E>
impl<E: CanDraw + CanCollide> CanCollide for VisibilityToggle<E>
Source§fn collides_with_pos(&self, pos: Vec2D) -> bool
fn collides_with_pos(&self, pos: Vec2D) -> bool
Returns
true
if the collider intersects the passed positionSource§impl<E: CanDraw> CanDraw for VisibilityToggle<E>
impl<E: CanDraw> CanDraw for VisibilityToggle<E>
Source§impl<E: Clone + CanDraw> Clone for VisibilityToggle<E>
impl<E: Clone + CanDraw> Clone for VisibilityToggle<E>
Source§fn clone(&self) -> VisibilityToggle<E>
fn clone(&self) -> VisibilityToggle<E>
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 moreAuto Trait Implementations§
impl<E> Freeze for VisibilityToggle<E>where
E: Freeze,
impl<E> RefUnwindSafe for VisibilityToggle<E>where
E: RefUnwindSafe,
impl<E> Send for VisibilityToggle<E>where
E: Send,
impl<E> Sync for VisibilityToggle<E>where
E: Sync,
impl<E> Unpin for VisibilityToggle<E>where
E: Unpin,
impl<E> UnwindSafe for VisibilityToggle<E>where
E: 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
Mutably borrows from an owned value. Read more