pub struct VisibilityToggle<E: ViewElement> {
pub element: E,
pub visible: bool,
}Expand description
VisibilityToggle is a container for a ViewElement with a property visible. When blit to the view the contained element will only appear if visible is true
Fields§
§element: EThe element held by the VisibilityToggle. Must implement ViewElement
visible: boolWhether the element is visible
Implementations§
Source§impl<E: ViewElement> VisibilityToggle<E>
impl<E: ViewElement> VisibilityToggle<E>
Trait Implementations§
Source§impl<E: Clone + ViewElement> Clone for VisibilityToggle<E>
impl<E: Clone + ViewElement> Clone for VisibilityToggle<E>
Source§fn clone(&self) -> VisibilityToggle<E>
fn clone(&self) -> VisibilityToggle<E>
Returns a copy 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<E: Debug + ViewElement> Debug for VisibilityToggle<E>
impl<E: Debug + ViewElement> Debug for VisibilityToggle<E>
Source§impl<T: ViewElement> ViewElement for VisibilityToggle<T>
impl<T: ViewElement> ViewElement for VisibilityToggle<T>
Source§fn active_pixels(&self) -> Vec<Pixel>
fn active_pixels(&self) -> Vec<Pixel>
Return a vector of the element’s
Pixels - A ColChar. If your whole object is a solid colour, consider using utils::points_to_pixels() which will add the same ColChar to every point and can then be used as this function’s outputSource§fn active_points(&self) -> Vec<Vec2D>
fn active_points(&self) -> Vec<Vec2D>
Return the positions the
ViewElement occupies, essentially active_pixels() without the ColChars. This has a default setting that extracts the Vec2Ds from active_pixels but you can set it to something else to make it fasterAuto 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)