pub struct QueueInner<T, S: Storage> { /* private fields */ }Expand description
Implementations§
Source§impl<T, const N: usize> QueueInner<T, OwnedStorage<N>>
impl<T, const N: usize> QueueInner<T, OwnedStorage<N>>
Source§impl<T, S: Storage> QueueInner<T, S>
impl<T, S: Storage> QueueInner<T, S>
Sourcepub fn as_view(&self) -> &QueueView<T>
pub fn as_view(&self) -> &QueueView<T>
Get a reference to the Queue, erasing the N const-generic.
let queue: Queue<u8, 2> = Queue::new();
let view: &QueueView<u8> = queue.as_view();It is often preferable to do the same through type coerction, since Queue<T, N> implements Unsize<QueueView<T>>:
let queue: Queue<u8, 2> = Queue::new();
let view: &QueueView<u8> = &queue;Sourcepub fn as_mut_view(&mut self) -> &mut QueueView<T>
pub fn as_mut_view(&mut self) -> &mut QueueView<T>
Get a mutable reference to the Queue, erasing the N const-generic.
let mut queue: Queue<u8, 2> = Queue::new();
let view: &mut QueueView<u8> = queue.as_mut_view();It is often preferable to do the same through type coerction, since Queue<T, N> implements Unsize<QueueView<T>>:
let mut queue: Queue<u8, 2> = Queue::new();
let view: &mut QueueView<u8> = &mut queue;