pub struct VertexAddr(/* private fields */);Expand description
The address of a vertex: a grid position or a symbol identity, in 8 bytes.
Implementations§
Source§impl VertexAddr
impl VertexAddr
Sourcepub const fn symbol(addr: SymbolAddr) -> Self
pub const fn symbol(addr: SymbolAddr) -> Self
Address of a vertex identified by name rather than position.
Sourcepub fn as_grid(self) -> Option<GridAddr>
pub fn as_grid(self) -> Option<GridAddr>
The grid position, or None for a symbol (or the invalid sentinel).
This is the only route from a stored vertex address to a (row, col), which is what
keeps symbols out of grid-keyed structures.
Sourcepub fn as_symbol(self) -> Option<SymbolAddr>
pub fn as_symbol(self) -> Option<SymbolAddr>
The symbol identity, or None for a grid position.
pub fn is_symbol(self) -> bool
pub fn is_grid(self) -> bool
pub const fn as_u64(self) -> u64
Trait Implementations§
Source§impl Clone for VertexAddr
impl Clone for VertexAddr
Source§fn clone(&self) -> VertexAddr
fn clone(&self) -> VertexAddr
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for VertexAddr
Source§impl Debug for VertexAddr
impl Debug for VertexAddr
Source§impl Default for VertexAddr
impl Default for VertexAddr
impl Eq for VertexAddr
Source§impl From<Coord> for VertexAddr
impl From<Coord> for VertexAddr
Source§impl From<GridAddr> for VertexAddr
impl From<GridAddr> for VertexAddr
Source§impl From<SymbolAddr> for VertexAddr
impl From<SymbolAddr> for VertexAddr
Source§fn from(addr: SymbolAddr) -> Self
fn from(addr: SymbolAddr) -> Self
Converts to this type from the input type.
Source§impl Hash for VertexAddr
impl Hash for VertexAddr
Source§impl PartialEq for VertexAddr
impl PartialEq for VertexAddr
impl StructuralPartialEq for VertexAddr
Auto Trait Implementations§
impl Freeze for VertexAddr
impl RefUnwindSafe for VertexAddr
impl Send for VertexAddr
impl Sync for VertexAddr
impl Unpin for VertexAddr
impl UnsafeUnpin for VertexAddr
impl UnwindSafe for VertexAddr
Blanket Implementations§
impl<T> Allocation for T
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more