pub struct NyarError { /* private fields */ }
Implementations§
Source§impl NyarError
impl NyarError
pub fn set_file(&mut self, file: SourceID)
pub fn with_file(self, file: SourceID) -> Self
pub fn set_span(&mut self, span: SourceSpan)
pub fn with_span(self, file: SourceSpan) -> Self
pub fn as_report(&self) -> Diagnostic
Source§impl NyarError
impl NyarError
pub fn duplicate_type(name: String, this: SourceSpan, last: SourceSpan) -> Self
pub fn duplicate_function( name: String, this: SourceSpan, last: SourceSpan, ) -> Self
pub fn duplicate_variable( name: String, this: SourceSpan, last: SourceSpan, ) -> Self
pub fn duplicate_key(name: String, this: SourceSpan, last: SourceSpan) -> Self
Source§impl NyarError
impl NyarError
pub fn syntax_error(message: impl Into<String>, position: SourceSpan) -> Self
pub fn runtime_error(message: impl Into<String>) -> Self
pub fn custom<S: ToString>(message: S) -> Self
Trait Implementations§
Source§impl Error for NyarError
impl Error for NyarError
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 Error for NyarError
impl Error for NyarError
Source§fn custom<T>(msg: T) -> Selfwhere
T: Display,
fn custom<T>(msg: T) -> Selfwhere
T: Display,
Raised when there is general error when deserializing a type. Read more
Source§fn invalid_type(unexp: Unexpected<'_>, exp: &dyn Expected) -> Self
fn invalid_type(unexp: Unexpected<'_>, exp: &dyn Expected) -> Self
Raised when a
Deserialize
receives a type different from what it was
expecting. Read moreSource§fn invalid_value(unexp: Unexpected<'_>, exp: &dyn Expected) -> Self
fn invalid_value(unexp: Unexpected<'_>, exp: &dyn Expected) -> Self
Raised when a
Deserialize
receives a value of the right type but that
is wrong for some other reason. Read moreSource§fn invalid_length(len: usize, exp: &dyn Expected) -> Self
fn invalid_length(len: usize, exp: &dyn Expected) -> Self
Raised when deserializing a sequence or map and the input data contains
too many or too few elements. Read more
Source§fn unknown_variant(variant: &str, expected: &'static [&'static str]) -> Self
fn unknown_variant(variant: &str, expected: &'static [&'static str]) -> Self
Raised when a
Deserialize
enum type received a variant with an
unrecognized name.Source§fn unknown_field(field: &str, expected: &'static [&'static str]) -> Self
fn unknown_field(field: &str, expected: &'static [&'static str]) -> Self
Raised when a
Deserialize
struct type received a field with an
unrecognized name.Source§fn missing_field(field: &'static str) -> Self
fn missing_field(field: &'static str) -> Self
Raised when a
Deserialize
struct type expected to receive a required
field with a particular name but that field was not present in the
input.Source§fn duplicate_field(field: &'static str) -> Self
fn duplicate_field(field: &'static str) -> Self
Raised when a
Deserialize
struct type received more than one of the
same field.Source§impl From<ForeignInterfaceError> for NyarError
impl From<ForeignInterfaceError> for NyarError
Source§fn from(value: ForeignInterfaceError) -> Self
fn from(value: ForeignInterfaceError) -> Self
Converts to this type from the input type.
Source§impl From<MissingError> for NyarError
impl From<MissingError> for NyarError
Source§fn from(value: MissingError) -> Self
fn from(value: MissingError) -> Self
Converts to this type from the input type.
Source§impl From<ParseBoolError> for NyarError
impl From<ParseBoolError> for NyarError
Source§fn from(value: ParseBoolError) -> Self
fn from(value: ParseBoolError) -> Self
Converts to this type from the input type.
Source§impl From<ParseCharError> for NyarError
impl From<ParseCharError> for NyarError
Source§fn from(value: ParseCharError) -> Self
fn from(value: ParseCharError) -> Self
Converts to this type from the input type.
Source§impl From<ParseError> for NyarError
impl From<ParseError> for NyarError
Source§fn from(value: ParseError) -> Self
fn from(value: ParseError) -> Self
Converts to this type from the input type.
Source§impl From<ParseFloatError> for NyarError
impl From<ParseFloatError> for NyarError
Source§fn from(error: ParseFloatError) -> Self
fn from(error: ParseFloatError) -> Self
Converts to this type from the input type.
Source§impl From<ParseIntError> for NyarError
impl From<ParseIntError> for NyarError
Source§fn from(error: ParseIntError) -> Self
fn from(error: ParseIntError) -> Self
Converts to this type from the input type.
Source§impl From<RuntimeError> for NyarError
impl From<RuntimeError> for NyarError
Source§fn from(value: RuntimeError) -> Self
fn from(value: RuntimeError) -> Self
Converts to this type from the input type.
Source§impl From<SyntaxError> for NyarError
impl From<SyntaxError> for NyarError
Source§fn from(value: SyntaxError) -> Self
fn from(value: SyntaxError) -> Self
Converts to this type from the input type.
impl Eq for NyarError
impl StructuralPartialEq for NyarError
Auto Trait Implementations§
impl Freeze for NyarError
impl RefUnwindSafe for NyarError
impl Send for NyarError
impl Sync for NyarError
impl Unpin for NyarError
impl UnwindSafe for NyarError
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