#[non_exhaustive]pub struct LayerManager {}Expand description
Type for managing the currently active layers.
Internally a stack-like datastructure is used to keep track of the order in which the layers got
activated. When pushing a new layer ID to the LayerManager it will become the active one and
a LayerManagerEntry is returned that can be used to deactive the layer again.
Implementations§
Source§impl LayerManager
impl LayerManager
Sourcepub fn new() -> Self
pub fn new() -> Self
Creates a new LayerManager.
Sourcepub fn push(&self, layer: LayerId) -> LayerManagerEntry
pub fn push(&self, layer: LayerId) -> LayerManagerEntry
Sets the active layer to the layer with the specified ID.
Sourcepub fn remove(&self, entry: LayerManagerEntry) -> LayerId
pub fn remove(&self, entry: LayerManagerEntry) -> LayerId
Deactivates the layer that was pushed to the stack with the specified LayerManagerEntry.
Trait Implementations§
Source§impl Clone for LayerManager
impl Clone for LayerManager
Source§fn clone(&self) -> LayerManager
fn clone(&self) -> LayerManager
Returns a duplicate of the value. Read more
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Default for LayerManager
impl Default for LayerManager
Source§fn default() -> LayerManager
fn default() -> LayerManager
Returns the “default value” for a type. Read more
impl Copy for LayerManager
Auto Trait Implementations§
impl Freeze for LayerManager
impl RefUnwindSafe for LayerManager
impl Send for LayerManager
impl Sync for LayerManager
impl Unpin for LayerManager
impl UnwindSafe for LayerManager
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