[−][src]Struct alg_ds::ds::table::Table
Methods
impl<T> Table<T> where
T: Default + Copy,
[src]
T: Default + Copy,
pub fn new(height: usize, width: usize) -> Table<T>
[src]
Creates new table, filled by default values.
pub fn new_with_fill(height: usize, width: usize, value: T) -> Table<T>
[src]
Creates new table, filled by given values.
pub fn fill(&mut self, value: T)
[src]
Fills the table with value
.
pub fn width(&self) -> usize
[src]
Returns table width.
pub fn height(&self) -> usize
[src]
Returns table height
pub fn nth(&self, index: usize) -> T
[src]
Returns the n-th element of the table.
pub fn elements(&self) -> Iter<T>
[src]
An iterator over table elements in line traversal order.
Trait Implementations
impl<T> Index<usize> for Table<T> where
T: Default + Copy,
[src]
T: Default + Copy,
type Output = [T]
The returned type after indexing.
fn index(&self, index: usize) -> &Self::Output
[src]
impl<T> IndexMut<usize> for Table<T> where
T: Default + Copy,
[src]
T: Default + Copy,
Auto Trait Implementations
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
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,