[−][src]Struct drumatech::structure::ArrayQueue
Fields
head: usize
size: usize
contents: Vec<T>
cap: usize
Methods
impl<T: Clone> ArrayQueue<T>
[src]
pub fn new(contents: Vec<T>) -> ArrayQueue<T>
[src]
pub fn resize(&mut self)
[src]
pub fn update(&mut self)
[src]
pub fn add(&mut self, x: T) -> bool
[src]
add the value with resizing contents capacities.
Examples
extern crate drumatech; use drumatech::structure; let mut arys : structure::ArrayQueue<u8> = structure::ArrayQueue::new(vec![1,2,3,4,5]); arys.add(30); assert_eq!(arys.contents.len(),6); assert_eq!(1,arys.contents[0]); assert_eq!(30,arys.contents[arys.size-1]);
pub fn remove(&mut self) -> T
[src]
remove the value with resizing contents capacities.
Examples
extern crate drumatech; use drumatech::structure; let mut arys : structure::ArrayQueue<u8> = structure::ArrayQueue::new(vec![1,2,3,4,5]); assert_eq!(1,arys.remove()); assert_eq!(arys.contents.len(),4); arys.add(30); assert_eq!(arys.contents.len(),5);
Auto Trait Implementations
impl<T> Send for ArrayQueue<T> where
T: Send,
T: Send,
impl<T> Sync for ArrayQueue<T> where
T: Sync,
T: Sync,
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,