pub struct ParseError {
pub type_: NameType,
pub code: Option<NomCode>,
pub name: String,
pub message: String,
}Expand description
Rust equivalent of Java UnparsableNameException (type/code/name/message).
Fields§
§type_: NameType§code: Option<NomCode>§name: String§message: StringImplementations§
Source§impl ParseError
impl ParseError
pub fn new( type_: NameType, code: Option<NomCode>, name: impl Into<String>, ) -> Self
Sourcepub fn clamped_to_unparsable(self) -> ParseError
pub fn clamped_to_unparsable(self) -> ParseError
Clamp a parsable NameType to NameType::Other so this error is legal as a 5.0.0
Unparsable result. The core’s error path can still tag an unrepresentable-but-informal
grouping ("Bartonella group", "Amauropeltoid clade") as INFORMAL, but the 5.0.0
ParseResult::Unparsable variant — mirroring Java’s, whose record rejects isParsable()
types — may only carry a non-parsable type. Applied ONLY at the 5.0.0 boundaries
(crate::parse and the FFI); crate::parse_name (the raw path, cross-validated
byte-for-byte against Java 4.2.0) keeps the original INFORMAL, so the golden oracles are
untouched. Rebuilds the message via Self::new so it names the clamped type.
Trait Implementations§
Source§impl Clone for ParseError
impl Clone for ParseError
Source§impl Debug for ParseError
impl Debug for ParseError
impl Eq for ParseError
Source§impl PartialEq for ParseError
impl PartialEq for ParseError
impl StructuralPartialEq for ParseError
Auto Trait Implementations§
impl Forget for ParseError
impl Freeze for ParseError
impl Move for ParseError
impl RefUnwindSafe for ParseError
impl Send for ParseError
impl Sync for ParseError
impl Unpin for ParseError
impl UnsafeUnpin for ParseError
impl UnwindSafe for ParseError
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