pub struct Atom(pub usize);
Expand description
A simple type to represent atoms: a wrapper around unsigned integers.
Implements Deref to usize
for ease of use. In terms of being parsed,
any atom less than 26 maps to a corresponding lowercase letter and those
from 26..52
map to the corresponding uppercase letter. If for whatever
reason you need more than 52 atoms, then they can only be printed/parsed
as the corresponding numbers.
Tuple Fields§
§0: usize
Methods from Deref<Target = usize>§
pub const MIN: usize = 0usize
pub const MAX: usize = 18_446_744_073_709_551_615usize
pub const BITS: u32 = 64u32
Trait Implementations§
source§impl Match for Atom
impl Match for Atom
source§fn get_match(s: &str) -> Option<Self>
fn get_match(s: &str) -> Option<Self>
A trait that, when implemented for a type T, implements a method that, given a string,
outputs a matching element of T if applicable.
Also, whitespace and strings starting with whitespace
can never be a match, as starting whitespace is always ignored by the parser.
source§impl Ord for Atom
impl Ord for Atom
source§impl PartialEq for Atom
impl PartialEq for Atom
source§impl PartialOrd for Atom
impl PartialOrd for Atom
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl Copy for Atom
impl Eq for Atom
impl StructuralEq for Atom
impl StructuralPartialEq for Atom
impl Symbolic for Atom
Auto Trait Implementations§
impl RefUnwindSafe for Atom
impl Send for Atom
impl Sync for Atom
impl Unpin for Atom
impl UnwindSafe for Atom
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