Struct php_parser_rs::parser::error::ParseError
source · 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 json_schema(gen: &mut SchemaGenerator) -> Schema
fn json_schema(gen: &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<ParseError> for ParseError
impl PartialEq<ParseError> for ParseError
source§fn eq(&self, other: &ParseError) -> bool
fn eq(&self, other: &ParseError) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.