pub struct Stack<T: Layer> { /* private fields */ }
Expand description
A stack of layers used for drawing.
Implementations§
Source§impl<T: Layer> Stack<T>
impl<T: Layer> Stack<T>
Sourcepub fn current_mut(&mut self) -> (&mut T, Transformation)
pub fn current_mut(&mut self) -> (&mut T, Transformation)
Sourcepub fn transformation(&self) -> Transformation
pub fn transformation(&self) -> Transformation
Returns the current [Transformation
] of the Stack
.
Sourcepub fn push_clip(&mut self, bounds: Rectangle)
pub fn push_clip(&mut self, bounds: Rectangle)
Pushes a new clipping region in the Stack
; creating a new layer in the
process.
Sourcepub fn pop_clip(&mut self)
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.
Sourcepub fn push_transformation(&mut self, transformation: Transformation)
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
.
Sourcepub fn pop_transformation(&mut self)
pub fn pop_transformation(&mut self)
Pops the current [Transformation
] in the Stack
.
Sourcepub fn iter_mut(&mut self) -> impl Iterator<Item = &mut T>
pub fn iter_mut(&mut self) -> impl Iterator<Item = &mut T>
Returns an iterator over mutable references to the layers in the Stack
.
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for Stack<T>
impl<T> RefUnwindSafe for Stack<T>where
T: RefUnwindSafe,
impl<T> Send for Stack<T>where
T: Send,
impl<T> Sync for Stack<T>where
T: Sync,
impl<T> Unpin for Stack<T>where
T: Unpin,
impl<T> UnwindSafe for Stack<T>where
T: 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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more§impl<T> NoneValue for Twhere
T: Default,
impl<T> NoneValue for Twhere
T: Default,
type NoneType = T
§fn null_value() -> T
fn null_value() -> T
The none-equivalent value.
§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian()
.