pub struct LayerStack { /* private fields */ }Expand description
An ordered stack of map layers, rendered bottom-to-top.
Implementations§
Source§impl LayerStack
impl LayerStack
Sourcepub fn from_vec(layers: Vec<Box<dyn Layer>>) -> Self
pub fn from_vec(layers: Vec<Box<dyn Layer>>) -> Self
Create a layer stack from an existing vector of layers.
Sourcepub fn insert(&mut self, index: usize, layer: Box<dyn Layer>)
pub fn insert(&mut self, index: usize, layer: Box<dyn Layer>)
Insert a layer at a specific index (0 = bottom).
Sourcepub fn remove(&mut self, index: usize) -> Option<Box<dyn Layer>>
pub fn remove(&mut self, index: usize) -> Option<Box<dyn Layer>>
Remove a layer by index. Returns it if valid.
Sourcepub fn remove_by_name(&mut self, name: &str) -> Option<Box<dyn Layer>>
pub fn remove_by_name(&mut self, name: &str) -> Option<Box<dyn Layer>>
Remove a layer by name. Returns it if found.
Sourcepub fn move_up(&mut self, index: usize) -> bool
pub fn move_up(&mut self, index: usize) -> bool
Move a layer up (toward the top of the stack / rendered last).
Returns true if the layer was moved.
Sourcepub fn move_down(&mut self, index: usize) -> bool
pub fn move_down(&mut self, index: usize) -> bool
Move a layer down (toward the bottom of the stack / rendered first).
Returns true if the layer was moved.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for LayerStack
impl !RefUnwindSafe for LayerStack
impl Send for LayerStack
impl Sync for LayerStack
impl Unpin for LayerStack
impl UnsafeUnpin for LayerStack
impl !UnwindSafe for LayerStack
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