pub struct TransformationStack { /* private fields */ }Expand description
A stack-allocated buffer for transformations to avoid heap allocations in the hot path.
This structure uses a fixed-size array and is extremely fast for frequent updates.
Implementations§
Source§impl TransformationStack
impl TransformationStack
Sourcepub fn push(&mut self, t: Transformation)
pub fn push(&mut self, t: Transformation)
Pushes a new transformation onto the stack. Does nothing if the stack is full.
Sourcepub fn pop(&mut self) -> Option<Transformation>
pub fn pop(&mut self) -> Option<Transformation>
Removes and returns the last transformation from the stack.
Sourcepub fn as_slice(&self) -> &[Transformation]
pub fn as_slice(&self) -> &[Transformation]
Returns a slice containing all transformations in the stack.
Sourcepub fn as_mut_slice(&mut self) -> &mut [Transformation]
pub fn as_mut_slice(&mut self) -> &mut [Transformation]
Returns a mutable slice containing all transformations in the stack.
Sourcepub fn extend_from_slice(&mut self, other: &[Transformation])
pub fn extend_from_slice(&mut self, other: &[Transformation])
Appends a slice of transformations to the stack.
Sourcepub fn drain_to(&mut self, start: usize, target: &mut TransformationStack)
pub fn drain_to(&mut self, start: usize, target: &mut TransformationStack)
Drains transformations from a starting index into another stack.
Trait Implementations§
Source§impl Clone for TransformationStack
impl Clone for TransformationStack
Source§fn clone(&self) -> TransformationStack
fn clone(&self) -> TransformationStack
Returns a duplicate 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 Debug for TransformationStack
impl Debug for TransformationStack
Source§impl Default for TransformationStack
impl Default for TransformationStack
Source§fn default() -> TransformationStack
fn default() -> TransformationStack
Returns the “default value” for a type. Read more
Source§impl Hash for TransformationStack
impl Hash for TransformationStack
Source§impl PartialEq for TransformationStack
impl PartialEq for TransformationStack
impl Copy for TransformationStack
impl Eq for TransformationStack
impl StructuralPartialEq for TransformationStack
Auto Trait Implementations§
impl Freeze for TransformationStack
impl RefUnwindSafe for TransformationStack
impl Send for TransformationStack
impl Sync for TransformationStack
impl Unpin for TransformationStack
impl UnsafeUnpin for TransformationStack
impl UnwindSafe for TransformationStack
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