pub struct SynxlError {
pub kind: SynxlErrorKind,
pub line: usize,
pub message: String,
}Expand description
A hard error (§11.1) with the 1-based source line that produced it.
Fields§
§kind: SynxlErrorKind§line: usize§message: StringImplementations§
Source§impl SynxlError
impl SynxlError
Sourcepub fn new(
kind: SynxlErrorKind,
line: usize,
message: impl Into<String>,
) -> SynxlError
pub fn new( kind: SynxlErrorKind, line: usize, message: impl Into<String>, ) -> SynxlError
Build an error.
Public because wrappers around this crate — language bindings in
particular — need to raise the same error type for conditions they
enforce themselves (a writer rejecting block combined with a type,
say) instead of assembling the struct literally.
Trait Implementations§
Source§impl Clone for SynxlError
impl Clone for SynxlError
Source§fn clone(&self) -> SynxlError
fn clone(&self) -> SynxlError
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 SynxlError
impl Debug for SynxlError
Source§impl Display for SynxlError
impl Display for SynxlError
impl Eq for SynxlError
Source§impl Error for SynxlError
impl Error for SynxlError
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<SynxlError> for SynxlStreamError
impl From<SynxlError> for SynxlStreamError
Source§fn from(e: SynxlError) -> SynxlStreamError
fn from(e: SynxlError) -> SynxlStreamError
Converts to this type from the input type.
Source§impl PartialEq for SynxlError
impl PartialEq for SynxlError
impl StructuralPartialEq for SynxlError
Auto Trait Implementations§
impl Freeze for SynxlError
impl RefUnwindSafe for SynxlError
impl Send for SynxlError
impl Sync for SynxlError
impl Unpin for SynxlError
impl UnsafeUnpin for SynxlError
impl UnwindSafe for SynxlError
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