Struct SignalQueue
pub struct SignalQueue<const CAP: usize = 16> { /* private fields */ }Expand description
Fixed-capacity FIFO ring buffer for AnimationSignal events (HotZeroHeap).
Implementations§
§impl<const CAP: usize> SignalQueue<CAP>
impl<const CAP: usize> SignalQueue<CAP>
pub const fn new() -> SignalQueue<CAP>
pub const fn new() -> SignalQueue<CAP>
Creates an empty signal queue.
pub const fn len(&self) -> usize
pub const fn is_empty(&self) -> bool
pub fn clear(&mut self)
pub fn push(&mut self, sig: AnimationSignal) -> bool
pub fn push(&mut self, sig: AnimationSignal) -> bool
Pushes a signal into the ring buffer. Returns false if full.
pub fn pop(&mut self) -> Option<AnimationSignal>
pub fn pop(&mut self) -> Option<AnimationSignal>
Pops the oldest signal from the ring buffer.
pub fn emit_crossed_signals(
&mut self,
triggers: &[SignalTrigger],
layer_index: u8,
state_index: u8,
prev_norm_t: f32,
curr_norm_t: f32,
looped: bool,
) -> usize
pub fn emit_crossed_signals( &mut self, triggers: &[SignalTrigger], layer_index: u8, state_index: u8, prev_norm_t: f32, curr_norm_t: f32, looped: bool, ) -> usize
Checks triggers against the playhead advancement (prev_norm_t, curr_norm_t]
(handling loop wrap-around cleanly) and pushes crossed events.
Trait Implementations§
§impl<const CAP: usize> Clone for SignalQueue<CAP>
impl<const CAP: usize> Clone for SignalQueue<CAP>
§fn clone(&self) -> SignalQueue<CAP>
fn clone(&self) -> SignalQueue<CAP>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl<const CAP: usize> Copy for SignalQueue<CAP>
§impl<const CAP: usize> Debug for SignalQueue<CAP>
impl<const CAP: usize> Debug for SignalQueue<CAP>
§impl<const CAP: usize> Default for SignalQueue<CAP>
impl<const CAP: usize> Default for SignalQueue<CAP>
§fn default() -> SignalQueue<CAP>
fn default() -> SignalQueue<CAP>
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl<const CAP: usize> Freeze for SignalQueue<CAP>
impl<const CAP: usize> RefUnwindSafe for SignalQueue<CAP>
impl<const CAP: usize> Send for SignalQueue<CAP>
impl<const CAP: usize> Sync for SignalQueue<CAP>
impl<const CAP: usize> Unpin for SignalQueue<CAP>
impl<const CAP: usize> UnsafeUnpin for SignalQueue<CAP>
impl<const CAP: usize> UnwindSafe for SignalQueue<CAP>
Blanket Implementations§
§impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
Aggregate shares in an MPC protocol.
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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.