pub struct Queue<T> { /* private fields */ }
Expand description
Queue data structure
Implementations§
Source§impl<T: Clone + Default> Queue<T>
impl<T: Clone + Default> Queue<T>
Sourcepub fn new(length: usize) -> Self
pub fn new(length: usize) -> Self
Create an empty queue of fixed size
use algorithms_rs::Queue;
let empty_queue = Queue::<i32>::new(1);
assert_eq!(empty_queue.is_empty(), true);
Sourcepub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
Determine if queue is empty
use algorithms_rs::Queue;
let empty_queue = Queue::<i32>::new(1);
assert_eq!(empty_queue.is_empty(), true);
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for Queue<T>
impl<T> RefUnwindSafe for Queue<T>where
T: RefUnwindSafe,
impl<T> Send for Queue<T>where
T: Send,
impl<T> Sync for Queue<T>where
T: Sync,
impl<T> Unpin for Queue<T>where
T: Unpin,
impl<T> UnwindSafe for Queue<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