Type Alias Stack

Source
pub type Stack = Stack<Layer>;

Aliased Type§

struct Stack { /* private fields */ }

Implementations

§

impl<T> Stack<T>
where T: Layer,

pub fn new() -> Stack<T>

Creates a new empty [Stack].

pub fn current_mut(&mut self) -> (&mut T, Transformation)

Returns a mutable reference to the current [Layer] of the [Stack], together with the current [Transformation].

pub fn transformation(&self) -> Transformation

Returns the current [Transformation] of the [Stack].

pub fn push_clip(&mut self, bounds: Rectangle)

Pushes a new clipping region in the [Stack]; creating a new layer in the process.

pub fn pop_clip(&mut self)

Pops the current clipping region from the [Stack] and restores the previous one.

The current layer will be recorded for drawing.

pub fn push_transformation(&mut self, transformation: Transformation)

Pushes a new [Transformation] in the [Stack].

Future drawing operations will be affected by this new [Transformation] until it is popped using pop_transformation.

pub fn pop_transformation(&mut self)

Pops the current [Transformation] in the [Stack].

pub fn iter_mut(&mut self) -> impl Iterator<Item = &mut T>

Returns an iterator over mutable references to the layers in the [Stack].

pub fn iter(&self) -> impl Iterator<Item = &T>

Returns an iterator over immutable references to the layers in the [Stack].

pub fn as_slice(&self) -> &[T]

Returns the slice of layers in the [Stack].

pub fn flush(&mut self)

Flushes and settles any primitives in the current layer of the [Stack].

pub fn clear(&mut self)

Clears the layers of the [Stack], allowing reuse.

This will normally keep layer allocations for future drawing operations.

Trait Implementations

§

impl<T> Debug for Stack<T>
where T: Debug + Layer,

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl<T> Default for Stack<T>
where T: Layer,

§

fn default() -> Stack<T>

Returns the “default value” for a type. Read more