pub struct Nag(pub u8);Expand description
A numeric annotation glyph like ?, !! or $42.
Tuple Fields§
§0: u8Implementations§
Source§impl Nag
impl Nag
Sourcepub const BRILLIANT_MOVE: Nag
pub const BRILLIANT_MOVE: Nag
A brilliant move (!!).
Sourcepub const SPECULATIVE_MOVE: Nag
pub const SPECULATIVE_MOVE: Nag
A speculative move (!?).
Sourcepub const DUBIOUS_MOVE: Nag
pub const DUBIOUS_MOVE: Nag
A dubious move (?!).
Sourcepub fn from_ascii(s: &[u8]) -> Result<Nag, InvalidNag>
pub fn from_ascii(s: &[u8]) -> Result<Nag, InvalidNag>
Tries to parse a NAG from ASCII.
§Examples
use pgn_reader::Nag;
assert_eq!(Nag::from_ascii(b"??"), Ok(Nag(4)));
assert_eq!(Nag::from_ascii(b"$24"), Ok(Nag(24)));§Errors
Returns an InvalidNag error if the input is neither a known glyph
(?!, !, …) nor a valid numeric annotation ($0, …, $255).
Trait Implementations§
Source§impl Ord for Nag
impl Ord for Nag
Source§impl PartialOrd for Nag
impl PartialOrd for Nag
impl Eq for Nag
impl StructuralPartialEq for Nag
Auto Trait Implementations§
impl Freeze for Nag
impl RefUnwindSafe for Nag
impl Send for Nag
impl Sync for Nag
impl Unpin for Nag
impl UnwindSafe for Nag
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