Struct toodee::TooDee

source ·
pub struct TooDee<T> { /* private fields */ }
Expand description

Represents a two-dimensional array.

Empty arrays will always have dimensions of zero.

Implementations§

source§

impl<T> TooDee<T>

source

pub fn new(num_cols: usize, num_rows: usize) -> TooDee<T>where T: Default,

Create a new TooDee array of the specified dimensions, and fill it with the type’s default value.

Panics

Panics if one of the dimensions is zero but the other is non-zero. This is to enforce the rule that empty arrays have no dimensions.

Panics if num_rows * num_cols overflows.

Examples
use toodee::{TooDee,TooDeeOps};
let toodee : TooDee<u32> = TooDee::new(10, 5);
assert_eq!(toodee.num_cols(), 10);
assert_eq!(toodee.num_rows(), 5);
assert_eq!(toodee[0][0], 0);
source

pub fn init(num_cols: usize, num_rows: usize, init_value: T) -> TooDee<T>where T: Clone,

Create a new TooDee array of the specified dimensions, and fill it with an initial value.

Panics

Panics if one of the dimensions is zero but the other is non-zero. This is to enforce the rule that empty arrays have no dimensions.

Panics if num_rows * num_cols overflows.

Examples
use toodee::{TooDee,TooDeeOps};
let toodee = TooDee::init(10, 5, 42u32);
assert_eq!(toodee.num_cols(), 10);
assert_eq!(toodee.num_rows(), 5);
assert_eq!(toodee[0][0], 42);
source

pub fn capacity(&self) -> usize

Returns the element capacity of the underlying Vec.

Examples
use toodee::TooDee;
let v = vec![42u32; 10];
let toodee : TooDee<u32> = TooDee::from_vec(5, 2, v);
assert!(toodee.capacity() >= 10);
source

pub fn with_capacity(capacity: usize) -> TooDee<T>

Constructs a new, empty TooDee<T> with the specified element capacity.

Examples
use toodee::TooDee;
let toodee : TooDee<u32> = TooDee::with_capacity(50);
assert!(toodee.capacity() >= 50);
source

pub fn reserve_exact(&mut self, capacity: usize)

Reserves the minimum capacity for at least additional more elements to be inserted into the TooDee<T>.

Examples
use toodee::TooDee;
let mut toodee : TooDee<u32> = TooDee::default();
toodee.reserve_exact(50);
assert_eq!(toodee.capacity(), 50);
source

pub fn reserve(&mut self, capacity: usize)

Reserves capacity for at least additional more elements to be inserted in the given TooDee<T>.

Examples
use toodee::TooDee;
let mut toodee : TooDee<u32> = TooDee::default();
toodee.reserve(50);
assert!(toodee.capacity() >= 50);
source

pub fn shrink_to_fit(&mut self)

Shrinks the capacity of the underlying vector as much as possible.

Examples
use toodee::TooDee;
let mut toodee : TooDee<u32> = TooDee::with_capacity(50);
toodee.shrink_to_fit();
assert_eq!(toodee.capacity(), 0);
source

pub fn from_vec(num_cols: usize, num_rows: usize, v: Vec<T>) -> TooDee<T>

Create a new TooDee array using the provided vector. The vector’s length must match the dimensions of the array.

Panics

Panics if one of the dimensions is zero but the other is non-zero. This is to enforce the rule that empty arrays have no dimensions.

Panics if num_cols * num_rows overflows.

Examples
use toodee::{TooDee,TooDeeOps};
let v = vec![42u32; 10];
let mut toodee : TooDee<u32> = TooDee::from_vec(5, 2, v);
assert_eq!(toodee.num_cols(), 5);
assert_eq!(toodee.num_rows(), 2);
assert_eq!(toodee[0][0], 42);
source

pub fn from_box(num_cols: usize, num_rows: usize, b: Box<[T]>) -> TooDee<T>

Create a new TooDee array using the provided boxed slice. The slice’s length must match the dimensions of the array.

Examples
use toodee::{TooDee,TooDeeOps};
let v = vec![42u32; 10];
let mut toodee : TooDee<u32> = TooDee::from_box(5, 2, v.into_boxed_slice());
assert_eq!(toodee.num_cols(), 5);
assert_eq!(toodee.num_rows(), 2);
assert_eq!(toodee[0][0], 42);
source

pub fn data(&self) -> &[T]

Returns a reference to the raw array data

Examples
use toodee::{TooDee,TooDeeOps};
let v = vec![42u32; 10];
let mut toodee : TooDee<u32> = TooDee::from_vec(5, 2, v);
assert_eq!(toodee.data()[0], 42);
source

pub fn data_mut(&mut self) -> &mut [T]

Returns a mutable reference to the raw array data

Examples
use toodee::{TooDee,TooDeeOps};
let v = vec![42u32; 10];
let mut toodee : TooDee<u32> = TooDee::from_vec(5, 2, v);
assert_eq!(toodee.data_mut()[0], 42);
source

pub fn clear(&mut self)

Clears the array, removing all values and zeroing the number of columns and rows.

Note that this method has no effect on the allocated capacity of the array.

Examples
use toodee::{TooDee,TooDeeOps};
let v = vec![42u32; 10];
let mut toodee : TooDee<u32> = TooDee::from_vec(5, 2, v);
toodee.clear();
assert_eq!(toodee.num_cols(), 0);
assert_eq!(toodee.num_rows(), 0);
assert!(toodee.capacity() >= 10);
source

pub fn pop_row(&mut self) -> Option<DrainRow<'_, T>>

Removes the last row from the array and returns it as a Drain, or None if it is empty.

Examples
use toodee::{TooDee,TooDeeOps};
let v = vec![42u32; 15];
let mut toodee : TooDee<u32> = TooDee::from_vec(5, 3, v);
{
   let drain = toodee.pop_row().unwrap();
   assert_eq!(drain.len(), 5);
}
assert_eq!(toodee.num_cols(), 5);
assert_eq!(toodee.num_rows(), 2);
source

pub fn push_row<I>(&mut self, data: impl IntoIterator<Item = T, IntoIter = I>)where I: Iterator<Item = T> + ExactSizeIterator,

Appends a new row to the array.

Panics

Panics if the data’s length doesn’t match the length of existing rows (if any).

source

pub fn insert_row<I>( &mut self, index: usize, data: impl IntoIterator<Item = T, IntoIter = I> )where I: Iterator<Item = T> + ExactSizeIterator,

Inserts new data into the array at the specified row

Panics

Panics if the data’s length doesn’t match the length of existing rows (if any).

source

pub fn remove_row(&mut self, index: usize) -> DrainRow<'_, T>

Removes the specified row from the array and returns it as a Drain

Panics

Panics if the specified row index is out of bounds.

Examples
use toodee::{TooDee,TooDeeOps};
let v = vec![42u32; 15];
let mut toodee : TooDee<u32> = TooDee::from_vec(5, 3, v);
{
   let drain = toodee.remove_row(1);
   assert_eq!(drain.len(), 5);
}
assert_eq!(toodee.num_cols(), 5);
assert_eq!(toodee.num_rows(), 2);
source

pub fn pop_col(&mut self) -> Option<DrainCol<'_, T>>

Removes the last column from the array and returns it as a Drain, or None if it is empty.

Examples
use toodee::{TooDee,TooDeeOps};
let v = vec![42u32; 15];
let mut toodee : TooDee<u32> = TooDee::from_vec(5, 3, v);
{
   let drain = toodee.pop_col().unwrap();
   assert_eq!(drain.len(), 3);
}
assert_eq!(toodee.num_cols(), 4);
assert_eq!(toodee.num_rows(), 3);
source

pub fn push_col<I>(&mut self, data: impl IntoIterator<Item = T, IntoIter = I>)where I: Iterator<Item = T> + ExactSizeIterator + DoubleEndedIterator,

Appends a new column to the array.

Panics

Panics if the data’s length doesn’t match the length of existing rows (if any).

source

pub fn remove_col(&mut self, index: usize) -> DrainCol<'_, T>

Removes the specified column from the array and returns it as a Drain

Panics

Panics if the specified column index is out of bounds.

Examples
use toodee::{TooDee,TooDeeOps};
let v = vec![42u32; 15];
let mut toodee : TooDee<u32> = TooDee::from_vec(5, 3, v);
{
   let drain = toodee.remove_col(1);
   assert_eq!(drain.len(), 3);
}
assert_eq!(toodee.num_cols(), 4);
assert_eq!(toodee.num_rows(), 3);
source

pub fn insert_col<I>( &mut self, index: usize, data: impl IntoIterator<Item = T, IntoIter = I> )where I: Iterator<Item = T> + ExactSizeIterator + DoubleEndedIterator,

Inserts new data into the array at the specified col.

Panics

Panics if the data’s length doesn’t match the length of existing columns (if any).

source

pub fn swap_dimensions(&mut self)

Switches the values for num_cols and num_rows without transposing the underlying data.

Trait Implementations§

source§

impl<T> AsMut<[T]> for TooDee<T>

source§

fn as_mut(&mut self) -> &mut [T]

Converts this type into a mutable reference of the (usually inferred) input type.
source§

impl<T> AsRef<[T]> for TooDee<T>

source§

fn as_ref(&self) -> &[T]

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl<T> AsRef<Vec<T, Global>> for TooDee<T>

We can allow immutable access to the underlying Vec, but not mutable access because that could lead to changes in the Vec’s length.

source§

fn as_ref(&self) -> &Vec<T>

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl<T: Clone> Clone for TooDee<T>

source§

fn clone(&self) -> TooDee<T>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<T> CopyOps<T> for TooDee<T>

source§

fn copy_from_slice(&mut self, src: &[T])where T: Copy,

Copies data from another slice into this area. The source slice’s length must match the size of this object’s area. Data is copied row by row. Read more
source§

fn clone_from_slice(&mut self, src: &[T])where T: Clone,

Clones data from another slice into this area. The source slice’s length must match the size of this object’s area. Data is cloned row by row. Read more
source§

fn copy_from_toodee(&mut self, src: &impl TooDeeOps<T>)where T: Copy,

Copies data from another TooDeeOps object into this one. The source and destination dimensions must match. Read more
source§

fn clone_from_toodee(&mut self, src: &impl TooDeeOps<T>)where T: Clone,

Copies data from another TooDeeOps object into this one. The source and destination dimensions must match. Read more
source§

impl<T> Debug for TooDee<T>where T: Debug,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<T> Default for TooDee<T>

Custom Default implementation because T does not need to implement Default. See rust issue #26925

source§

fn default() -> Self

Examples
use toodee::TooDee;
struct Abc { }
let toodee : TooDee<Abc> = TooDee::default();
source§

impl<'de, T> Deserialize<'de> for TooDee<T>where T: Deserialize<'de>,

source§

fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl<T> From<TooDee<T>> for Box<[T]>

Support conversion into a boxed slice.

source§

fn from(toodee: TooDee<T>) -> Box<[T]>

Converts to this type from the input type.
source§

impl<T> From<TooDee<T>> for Vec<T>

Support conversion into a Vec.

source§

fn from(toodee: TooDee<T>) -> Vec<T>

Converts to this type from the input type.
source§

impl<T> From<TooDeeView<'_, T>> for TooDee<T>where T: Clone,

source§

fn from(view: TooDeeView<'_, T>) -> Self

Converts to this type from the input type.
source§

impl<T> From<TooDeeViewMut<'_, T>> for TooDee<T>where T: Clone,

source§

fn from(view: TooDeeViewMut<'_, T>) -> Self

Converts to this type from the input type.
source§

impl<T: Hash> Hash for TooDee<T>

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl<T> Index<(usize, usize)> for TooDee<T>

source§

fn index(&self, coord: Coordinate) -> &Self::Output

Examples
use toodee::{TooDee,TooDeeOps,TooDeeOpsMut};
let toodee : TooDee<u32> = TooDee::new(10, 5);
assert_eq!(toodee[(1,3)], 0);
§

type Output = T

The returned type after indexing.
source§

impl<T> Index<usize> for TooDee<T>

source§

fn index(&self, row: usize) -> &Self::Output

Examples
use toodee::{TooDee,TooDeeOps,TooDeeOpsMut};
let toodee : TooDee<u32> = TooDee::new(10, 5);
let row = &toodee[3];
assert_eq!(row.len(), 10);
§

type Output = [T]

The returned type after indexing.
source§

impl<T> IndexMut<(usize, usize)> for TooDee<T>

source§

fn index_mut(&mut self, coord: Coordinate) -> &mut Self::Output

Examples
use toodee::{TooDee,TooDeeOps,TooDeeOpsMut};
let toodee : TooDee<u32> = TooDee::new(10, 5);
assert_eq!(toodee[(1,3)], 0);
source§

impl<T> IndexMut<usize> for TooDee<T>

source§

fn index_mut(&mut self, row: usize) -> &mut Self::Output

Examples
use toodee::{TooDee,TooDeeOps,TooDeeOpsMut};
let mut toodee : TooDee<u32> = TooDee::new(10, 5);
let mut row = &mut toodee[3];
row[0] = 42;
source§

impl<'a, T> IntoIterator for &'a TooDee<T>

source§

fn into_iter(self) -> Self::IntoIter

Cells is the preferred iterator type here, because it implements TooDeeIterator

§

type Item = &'a T

The type of the elements being iterated over.
§

type IntoIter = FlattenExact<Rows<'a, T>>

Which kind of iterator are we turning this into?
source§

impl<'a, T> IntoIterator for &'a mut TooDee<T>

§

type IntoIter = FlattenExact<RowsMut<'a, T>>

CellsMut is the preferred iterator type here, because it implements TooDeeIterator

§

type Item = &'a mut T

The type of the elements being iterated over.
source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
source§

impl<T> IntoIterator for TooDee<T>

Use Vec’s IntoIter for performance reasons.

TODO: return type that implements TooDeeIterator

§

type Item = T

The type of the elements being iterated over.
§

type IntoIter = IntoIter<T, Global>

Which kind of iterator are we turning this into?
source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
source§

impl<T: PartialEq> PartialEq<TooDee<T>> for TooDee<T>

source§

fn eq(&self, other: &TooDee<T>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<T> Serialize for TooDee<T>where T: Serialize,

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl<T> TooDeeOps<T> for TooDee<T>

source§

fn num_cols(&self) -> usize

Examples
use toodee::{TooDee,TooDeeOps,TooDeeOpsMut};
let toodee : TooDee<u32> = TooDee::new(10, 5);
assert_eq!(toodee.num_cols(), 10);
source§

fn num_rows(&self) -> usize

Examples
use toodee::{TooDee,TooDeeOps,TooDeeOpsMut};
let toodee : TooDee<u32> = TooDee::new(10, 5);
assert_eq!(toodee.num_rows(), 5);
source§

fn view(&self, start: Coordinate, end: Coordinate) -> TooDeeView<'_, T>

Examples
use toodee::{TooDee,TooDeeOps};
let toodee : TooDee<u32> = TooDee::new(10, 5);
let view = toodee.view((1,2), (8,4));
assert_eq!(view.num_cols(), 7);
assert_eq!(view.num_rows(), 2);
source§

fn rows(&self) -> Rows<'_, T>

Examples
use toodee::{TooDee,TooDeeOps,TooDeeOpsMut};
let mut toodee : TooDee<u32> = TooDee::new(10, 5);
let mut rows = toodee.rows();
assert_eq!(rows.len(), 5);
let r0 = rows.next().unwrap();
assert_eq!(r0.len(), 10);
source§

fn col(&self, col: usize) -> Col<'_, T>

Examples
use toodee::{TooDee,TooDeeOps,TooDeeOpsMut};
let mut toodee : TooDee<u32> = TooDee::new(10, 5);
let mut col = toodee.col(8);
assert_eq!(col.len(), 5);
source§

unsafe fn get_unchecked_row(&self, row: usize) -> &[T]

Examples
use toodee::{TooDee,TooDeeOps,TooDeeOpsMut};
unsafe {
    let toodee : TooDee<u32> = TooDee::new(10, 5);
    let row = toodee.get_unchecked_row(3);
    assert_eq!(row.len(), 10);
}
source§

unsafe fn get_unchecked(&self, coord: Coordinate) -> &T

Examples
use toodee::{TooDee,TooDeeOps,TooDeeOpsMut};
let toodee : TooDee<u32> = TooDee::new(10, 5);
unsafe {
    assert_eq!(*toodee.get_unchecked((1,3)), 0);
}
source§

fn size(&self) -> (usize, usize)

Returns the size/dimensions of the current object.
source§

fn is_empty(&self) -> bool

Returns true if the array contains no elements.
source§

fn cells(&self) -> Cells<'_, T>

Returns an iterator that traverses all cells within the area. Read more
source§

impl<T> TooDeeOpsMut<T> for TooDee<T>

source§

fn view_mut( &mut self, start: Coordinate, end: Coordinate ) -> TooDeeViewMut<'_, T>

Examples
use toodee::{TooDee,TooDeeOps,TooDeeOpsMut};
let mut toodee : TooDee<u32> = TooDee::new(10, 5);
let view = toodee.view_mut((1,2), (8,4));
assert_eq!(view.num_cols(), 7);
assert_eq!(view.num_rows(), 2);
source§

fn rows_mut(&mut self) -> RowsMut<'_, T>

Examples
use toodee::{TooDee,TooDeeOps,TooDeeOpsMut};
let mut toodee : TooDee<u32> = TooDee::new(10, 5);
let mut rows = toodee.rows_mut();
assert_eq!(rows.len(), 5);
let r0 = rows.next().unwrap();
assert_eq!(r0.len(), 10);
source§

fn col_mut(&mut self, col: usize) -> ColMut<'_, T>

Examples
use toodee::{TooDee,TooDeeOps,TooDeeOpsMut};
let mut toodee : TooDee<u32> = TooDee::new(10, 5);
let mut col = toodee.col_mut(8);
assert_eq!(col.len(), 5);
source§

fn fill(&mut self, fill: T)where T: Clone,

Examples
use toodee::{TooDee,TooDeeOps,TooDeeOpsMut};
let mut toodee : TooDee<u32> = TooDee::new(10, 5);
toodee.fill(42);
assert_eq!(toodee[1][1], 42);
source§

fn swap_rows(&mut self, r1: usize, r2: usize)

Swap/exchange the data between two rows.

Panics

Panics if either row index is out of bounds.

Examples
use toodee::{TooDee,TooDeeOps,TooDeeOpsMut};
let mut toodee : TooDee<u32> = TooDee::init(10, 5, 42u32);
toodee[0].iter_mut().for_each(|v| *v = 1);
assert_eq!(toodee[(0, 2)], 42);
toodee.swap_rows(0, 2);
assert_eq!(toodee[(0, 2)], 1);
source§

unsafe fn get_unchecked_row_mut(&mut self, row: usize) -> &mut [T]

Examples
use toodee::{TooDee,TooDeeOps,TooDeeOpsMut};
unsafe {
    let mut toodee : TooDee<u32> = TooDee::new(10, 5);
    let row = toodee.get_unchecked_row_mut(3);
    assert_eq!(row.len(), 10);
}
source§

unsafe fn get_unchecked_mut(&mut self, coord: Coordinate) -> &mut T

Examples
use toodee::{TooDee,TooDeeOps,TooDeeOpsMut};
let mut toodee : TooDee<u32> = TooDee::new(10, 5);
unsafe {
    assert_eq!(*toodee.get_unchecked_mut((1,3)), 0);
}
source§

fn swap(&mut self, (col1, row1): Coordinate, (col2, row2): Coordinate)

Swap/exchange two cells in the array.

Panics

Panics if either cell coordinate is out of bounds.

Examples
use toodee::{TooDee,TooDeeOps,TooDeeOpsMut};
let mut toodee = TooDee::from_vec(3, 3, (0u32..9).collect());
toodee.swap((0,0),(2, 2));
assert_eq!(toodee.data(), &[8, 1, 2, 3, 4, 5, 6, 7, 0]);
source§

fn cells_mut(&mut self) -> CellsMut<'_, T>

Returns an iterator that traverses all cells within the area. Read more
source§

fn swap_cols(&mut self, c1: usize, c2: usize)

Swap/exchange the data between two columns. Read more
source§

fn row_pair_mut(&mut self, r1: usize, r2: usize) -> (&mut [T], &mut [T])

Return the specified rows as mutable slices. Read more
source§

impl<T: Eq> Eq for TooDee<T>

source§

impl<T> StructuralEq for TooDee<T>

source§

impl<T> StructuralPartialEq for TooDee<T>

Auto Trait Implementations§

§

impl<T> RefUnwindSafe for TooDee<T>where T: RefUnwindSafe,

§

impl<T> Send for TooDee<T>where T: Send,

§

impl<T> Sync for TooDee<T>where T: Sync,

§

impl<T> Unpin for TooDee<T>where T: Unpin,

§

impl<T> UnwindSafe for TooDee<T>where T: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, O> SortOps<T> for Owhere O: TooDeeOpsMut<T>,

source§

fn sort_row_ord<F>(&mut self, row: usize)where T: Ord,

Sort the entire two-dimensional array by comparing elements on a specific row, using the natural ordering. This sort is stable.
source§

fn sort_unstable_row_ord<F>(&mut self, row: usize)where T: Ord,

Sort the entire two-dimensional array by comparing elements on a specific row, using the natural ordering. This sort is unstable.
source§

fn sort_by_row<F>(&mut self, row: usize, compare: F)where F: FnMut(&T, &T) -> Ordering,

Sort the entire two-dimensional array by comparing elements on a specific row using the provided compare function. This sort is stable.
source§

fn sort_unstable_by_row<F>(&mut self, row: usize, compare: F)where F: FnMut(&T, &T) -> Ordering,

Sort the entire two-dimensional array by comparing elements on a specific row using the provided compare function. This sort is unstable.
source§

fn sort_by_row_key<B, F>(&mut self, row: usize, f: F)where B: Ord, F: FnMut(&T) -> B,

Sort the entire two-dimensional array by comparing elements on a specific row using a key extraction function. This sort is stable.
source§

fn sort_unstable_by_row_key<B, F>(&mut self, row: usize, f: F)where B: Ord, F: FnMut(&T) -> B,

Sort the entire two-dimensional array by comparing elements on a specific row using a key extraction function. This sort is unstable.
source§

fn sort_col_ord<F>(&mut self, col: usize)where T: Ord,

Sort the entire two-dimensional array by comparing elements on a specific column using the natural ordering. This sort is stable.
source§

fn sort_by_col<F>(&mut self, col: usize, compare: F)where F: FnMut(&T, &T) -> Ordering,

Sort the entire two-dimensional array by comparing elements on in a specific column. This sort is stable.
source§

fn sort_unstable_by_col<F>(&mut self, col: usize, compare: F)where F: FnMut(&T, &T) -> Ordering,

Sort the entire two-dimensional array by comparing elements on in a specific column. This sort is unstable.
source§

fn sort_by_col_key<B, F>(&mut self, col: usize, f: F)where B: Ord, F: FnMut(&T) -> B,

Sort the entire two-dimensional array by comparing elements on a specific column using a key extraction function. This sort is stable.
source§

fn sort_unstable_by_col_key<B, F>(&mut self, col: usize, f: F)where B: Ord, F: FnMut(&T) -> B,

Sort the entire two-dimensional array by comparing elements on a specific column using a key extraction function. This sort is unstable.
source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, O> TranslateOps<T> for Owhere O: TooDeeOpsMut<T>,

source§

fn translate_with_wrap(&mut self, mid: Coordinate)

Translate (or scroll) the entire area. The mid coordinate will be moved to (0, 0), and all other elements will be moved in the same fashion. All the original data is preserved by wrapping at the array edges. Read more
source§

fn flip_rows(&mut self)

Flips (or mirrors) the rows. Read more
source§

fn flip_cols(&mut self)

Flips (or mirrors) the columns. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> DeserializeOwned for Twhere T: for<'de> Deserialize<'de>,