[−][src]Struct beehive::HexMap
A generic QuadPrism-shaped dense container indexed by hex coordinates.
This type is only available with the collections
feature.
Methods
impl<T, I: Subscript> HexMap<T, I>
[src]
pub fn create(area: QuadPrism<I>, value: T) -> Self where
T: Clone,
[src]
T: Clone,
pub fn create_with_axial<F>(area: QuadPrism<I>, initializer: F) -> Self where
F: FnMut(PointAxial<I>) -> T,
[src]
F: FnMut(PointAxial<I>) -> T,
pub fn create_with<F>(area: QuadPrism<I>, initializer: F) -> Self where
F: FnMut(Point<I>) -> T,
[src]
F: FnMut(Point<I>) -> T,
pub fn create_from_axial<U, F>(base: HexMap<U, I>, op: F) -> Self where
F: FnMut(PointAxial<I>, U) -> T,
[src]
F: FnMut(PointAxial<I>, U) -> T,
Creates from an existing HexMap
pub fn create_from<U, F>(base: HexMap<U, I>, op: F) -> Self where
F: FnMut(Point<I>, U) -> T,
[src]
F: FnMut(Point<I>, U) -> T,
Creates from an existing HexMap
pub fn create_from_ref_axial<U, F>(base: &HexMap<U, I>, op: F) -> Self where
F: FnMut(PointAxial<I>, &U) -> T,
[src]
F: FnMut(PointAxial<I>, &U) -> T,
Creates from reference of an existing HexMap
pub fn create_from_ref<U, F>(base: &HexMap<U, I>, op: F) -> Self where
F: FnMut(Point<I>, &U) -> T,
[src]
F: FnMut(Point<I>, &U) -> T,
Creates from reference of an existing HexMap
pub fn from_raw(area: QuadPrism<I>, data: Vec<T>) -> Self
[src]
pub fn try_from_raw(
area: QuadPrism<I>,
data: Vec<T>
) -> Result<Self, RawSizeMismatch>
[src]
area: QuadPrism<I>,
data: Vec<T>
) -> Result<Self, RawSizeMismatch>
pub fn area(&self) -> &QuadPrism<I>
[src]
Returns the QuadPrism
that this HexMap
covers.
pub fn get_axial(&self, point: PointAxial<I>) -> Option<&T>
[src]
Returns a reference to a value, or None
if the point is out of bounds.
pub fn get(&self, point: Point<I>) -> Option<&T>
[src]
Returns a reference to a value, or None
if the point is out of bounds.
pub fn get_mut_axial(&mut self, point: PointAxial<I>) -> Option<&mut T>
[src]
Returns a mutable reference to a value, or None
if the point is out of
bounds.
pub fn get_mut(&mut self, point: Point<I>) -> Option<&mut T>
[src]
Returns a mutable reference to a value, or None
if the point is out of
bounds.
pub fn iter_axial(&self) -> IterAxial<T, I>
[src]
Returns an iterator that yields axial coordinates and references to corresponding values.
pub fn iter(&self) -> Iter<T, I>
[src]
Returns an iterator that yields cube coordinates and references to corresponding values.
pub fn iter_mut_axial(&mut self) -> IterMutAxial<T, I>
[src]
Returns an iterator that yields axial coordinates and mutable references to corresponding values.
pub fn iter_mut(&mut self) -> IterMut<T, I>
[src]
Returns an iterator that yields cube coordinates and mutable references to corresponding values.
Trait Implementations
impl<T: Clone, I: Clone> Clone for HexMap<T, I>
[src]
impl<T: Debug, I: Debug> Debug for HexMap<T, I>
[src]
impl<T> Default for HexMap<T>
[src]
impl<T: Eq, I: Eq> Eq for HexMap<T, I>
[src]
impl<T, I: Subscript> Index<Point<I>> for HexMap<T, I>
[src]
impl<T, I: Subscript> Index<PointAxial<I>> for HexMap<T, I>
[src]
impl<T, I: Subscript> IndexMut<Point<I>> for HexMap<T, I>
[src]
impl<T, I: Subscript> IndexMut<PointAxial<I>> for HexMap<T, I>
[src]
fn index_mut(&mut self, point: PointAxial<I>) -> &mut T
[src]
impl<T: PartialEq, I: PartialEq> PartialEq<HexMap<T, I>> for HexMap<T, I>
[src]
impl<T, I> StructuralEq for HexMap<T, I>
[src]
impl<T, I> StructuralPartialEq for HexMap<T, I>
[src]
Auto Trait Implementations
impl<T, I> RefUnwindSafe for HexMap<T, I> where
I: RefUnwindSafe,
T: RefUnwindSafe,
I: RefUnwindSafe,
T: RefUnwindSafe,
impl<T, I> Send for HexMap<T, I> where
I: Send,
T: Send,
I: Send,
T: Send,
impl<T, I> Sync for HexMap<T, I> where
I: Sync,
T: Sync,
I: Sync,
T: Sync,
impl<T, I> Unpin for HexMap<T, I> where
I: Unpin,
T: Unpin,
I: Unpin,
T: Unpin,
impl<T, I> UnwindSafe for HexMap<T, I> where
I: UnwindSafe,
T: UnwindSafe,
I: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut 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>,