pub struct ParseError {
pub id: String,
pub message: String,
pub span: Span,
pub annotations: Vec<ParseErrorAnnotation>,
pub note: Option<String>,
}
Fields§
§id: String
§message: String
§span: Span
§annotations: Vec<ParseErrorAnnotation>
§note: Option<String>
Implementations§
Source§impl ParseError
impl ParseError
pub fn new<TId: ToString, TMessage: ToString>( id: TId, message: TMessage, span: Span, ) -> Self
pub fn highlight(self, position: usize, length: usize) -> Self
pub fn error<T: ToString>( self, message: T, position: usize, length: usize, ) -> Self
pub fn note<T: ToString>(self, note: T) -> Self
pub fn report<'a>( &self, source: &'a str, origin: Option<&'a str>, colored: bool, ascii: bool, ) -> Result<String>
Trait Implementations§
Source§impl Clone for ParseError
impl Clone for ParseError
Source§fn clone(&self) -> ParseError
fn clone(&self) -> ParseError
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 ParseError
impl Debug for ParseError
Source§impl<'de> Deserialize<'de> for ParseError
impl<'de> Deserialize<'de> for ParseError
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for ParseError
impl Display for ParseError
Source§impl From<SyntaxError> for ParseError
impl From<SyntaxError> for ParseError
Source§fn from(e: SyntaxError) -> Self
fn from(e: SyntaxError) -> Self
Converts to this type from the input type.
Source§impl JsonSchema for ParseError
impl JsonSchema for ParseError
Source§fn schema_name() -> String
fn schema_name() -> String
The name of the generated JSON Schema. Read more
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
Whether JSON Schemas generated for this type should be re-used where possible using the
$ref
keyword. Read moreSource§impl PartialEq for ParseError
impl PartialEq for ParseError
Source§impl Serialize for ParseError
impl Serialize for ParseError
impl Eq for ParseError
impl StructuralPartialEq for ParseError
Auto Trait Implementations§
impl Freeze for ParseError
impl RefUnwindSafe for ParseError
impl Send for ParseError
impl Sync for ParseError
impl Unpin 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