pub struct ShapeId(/* private fields */);Expand description
A shape’s identity: the ordinal a figure is drawn under, and what a buffer records beside each cell that figure decided.
Built from its ordinal by ShapeId::new and written back out as the bare number, 1 and 2
and so on. It is Copy, and it carries one rule of its own: zero is not an identity.
Implementations§
Source§impl ShapeId
impl ShapeId
Sourcepub fn new(ordinal: NonZeroU16) -> Self
pub fn new(ordinal: NonZeroU16) -> Self
Builds an identity from its ordinal — 1, 2, and so on.
The NonZeroU16 is the rule that 0 is not an identity, so a caller cannot ask for one:
what a plain number would have to be checked for is instead a type a zero cannot have.
Trait Implementations§
impl Copy for ShapeId
impl Eq for ShapeId
impl StructuralPartialEq for ShapeId
Auto Trait Implementations§
impl Forget for ShapeId
impl Freeze for ShapeId
impl RefUnwindSafe for ShapeId
impl Send for ShapeId
impl Sync for ShapeId
impl Unpin for ShapeId
impl UnsafeUnpin for ShapeId
impl UnwindSafe for ShapeId
Blanket Implementations§
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