pub enum ParsePtnError {
Tag(ParseTagError),
Move(ParseMoveError),
IncompleteMoveNum,
UnclosedComment,
GarbageAfterResult,
}
Expand description
Error returned when something goes wrong during the parsing of a Ptn
.
Variants§
Tag(ParseTagError)
Wrapper variant for ParseTagError
. Returned if something is wrong with a tag.
Move(ParseMoveError)
Wrapper variant for ParseMoveError
. Returned if there is an issue with one of the moves.
IncompleteMoveNum
Returned when the Ptn ends with a number without a dot. This kind of error is not returned
if there is an issue with the move numbers in the middle of the PTN. Instead that number will parsed as a move,
and if it is not a valid move, then the Move
variant of this error will be returned instead.
UnclosedComment
Returned when the PTN ends while still in comment mode. This happens if a comment is opened, but not closed.
GarbageAfterResult
Returned if there is non-whitespace text after a game result.
Trait Implementations§
Source§impl Clone for ParsePtnError
impl Clone for ParsePtnError
Source§fn clone(&self) -> ParsePtnError
fn clone(&self) -> ParsePtnError
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for ParsePtnError
impl Debug for ParsePtnError
Source§impl Display for ParsePtnError
impl Display for ParsePtnError
Source§impl Error for ParsePtnError
impl Error for ParsePtnError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Source§impl From<ParseMoveError> for ParsePtnError
impl From<ParseMoveError> for ParsePtnError
Source§fn from(value: ParseMoveError) -> Self
fn from(value: ParseMoveError) -> Self
Converts to this type from the input type.
Source§impl From<ParseTagError> for ParsePtnError
impl From<ParseTagError> for ParsePtnError
Source§fn from(value: ParseTagError) -> Self
fn from(value: ParseTagError) -> Self
Converts to this type from the input type.
Source§impl Hash for ParsePtnError
impl Hash for ParsePtnError
Source§impl Ord for ParsePtnError
impl Ord for ParsePtnError
Source§fn cmp(&self, other: &ParsePtnError) -> Ordering
fn cmp(&self, other: &ParsePtnError) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for ParsePtnError
impl PartialEq for ParsePtnError
Source§impl PartialOrd for ParsePtnError
impl PartialOrd for ParsePtnError
impl Copy for ParsePtnError
impl Eq for ParsePtnError
impl StructuralPartialEq for ParsePtnError
Auto Trait Implementations§
impl Freeze for ParsePtnError
impl RefUnwindSafe for ParsePtnError
impl Send for ParsePtnError
impl Sync for ParsePtnError
impl Unpin for ParsePtnError
impl UnwindSafe for ParsePtnError
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