Struct moa_host::traits::ClockedQueue
source · pub struct ClockedQueue<T>(Arc<Mutex<VecDeque<(Instant, T)>>>, usize);
Tuple Fields§
§0: Arc<Mutex<VecDeque<(Instant, T)>>>
§1: usize
Implementations§
source§impl<T: Clone> ClockedQueue<T>
impl<T: Clone> ClockedQueue<T>
pub fn new(max: usize) -> Self
pub fn push(&self, clock: Instant, data: T)
pub fn pop_next(&self) -> Option<(Instant, T)>
pub fn pop_latest(&self) -> Option<(Instant, T)>
pub fn put_back(&self, clock: Instant, data: T)
pub fn peek_clock(&self) -> Option<Instant>
pub fn is_empty(&self) -> bool
Trait Implementations§
source§impl<T: Clone> Clone for ClockedQueue<T>
impl<T: Clone> Clone for ClockedQueue<T>
source§fn clone(&self) -> ClockedQueue<T>
fn clone(&self) -> ClockedQueue<T>
Returns a copy 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<T: Default> Default for ClockedQueue<T>
impl<T: Default> Default for ClockedQueue<T>
source§fn default() -> ClockedQueue<T>
fn default() -> ClockedQueue<T>
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl<T> Freeze for ClockedQueue<T>
impl<T> RefUnwindSafe for ClockedQueue<T>
impl<T> Send for ClockedQueue<T>where
T: Send,
impl<T> Sync for ClockedQueue<T>where
T: Send,
impl<T> Unpin for ClockedQueue<T>
impl<T> UnwindSafe for ClockedQueue<T>
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