Get

Trait Get 

Source
pub trait Get {
    type Output;

    // Required methods
    fn get_option(&self, point: Point) -> Option<&Self::Output>;
    fn get_mut_option(&mut self, point: Point) -> Option<&mut Self::Output>;
}
Expand description

This trait is used to get a value from a 2d array. If the operation fails, either because the point is out of bounds or because the conversion from isize to usize fails, None is returned.

Required Associated Types§

Required Methods§

Source

fn get_option(&self, point: Point) -> Option<&Self::Output>

Source

fn get_mut_option(&mut self, point: Point) -> Option<&mut Self::Output>

Implementations on Foreign Types§

Source§

impl<A> Get for Vec<Vec<A>>

Source§

type Output = A

Source§

fn get_option(&self, point: Point) -> Option<&Self::Output>

Source§

fn get_mut_option(&mut self, point: Point) -> Option<&mut Self::Output>

Source§

impl<A, const SIZE_INNER: usize, const SIZE_OUTER: usize> Get for [[A; SIZE_INNER]; SIZE_OUTER]

Source§

type Output = A

Source§

fn get_option(&self, point: Point) -> Option<&Self::Output>

Source§

fn get_mut_option(&mut self, point: Point) -> Option<&mut Self::Output>

Implementors§