Skip to main content

PosGet

Trait PosGet 

Source
pub trait PosGet<V> {
    // Required methods
    fn pos_get(&self, pos: Pos) -> Option<&V>;
    fn pos_get_mut(&mut self, pos: Pos) -> Option<&mut V>;
}
Expand description

Allows indexing with a Pos instance.

Required Methods§

Source

fn pos_get(&self, pos: Pos) -> Option<&V>

Returns a reference to the value at pos, or None if the position cannot index the type.

Source

fn pos_get_mut(&mut self, pos: Pos) -> Option<&mut V>

Returns a mutable reference to the value at pos, or None if the position cannot index the type.

Implementations on Foreign Types§

Source§

impl<V> PosGet<V> for Grid<V>

Source§

fn pos_get(&self, pos: Pos) -> Option<&V>

Source§

fn pos_get_mut(&mut self, pos: Pos) -> Option<&mut V>

Implementors§