pub struct ScanError { /* private fields */ }Expand description
An error that occurred while reading, scanning, or parsing YAML.
Implementations§
Source§impl ScanError
impl ScanError
Sourcepub fn new(loc: Marker, message: impl Into<String>) -> ScanError
pub fn new(loc: Marker, message: impl Into<String>) -> ScanError
Create an externally supplied error from a location and message.
The message is stored in ErrorKind::Custom. This is useful for adapters that
participate in parser APIs, such as a custom ParserTrait
implementation or a ParserStack include resolver.
Sourcepub fn try_into_input_io_error(self) -> Result<InputIoError, Self>
pub fn try_into_input_io_error(self) -> Result<InputIoError, Self>
Extract the input I/O error details without cloning them.
§Errors
Returns the original scan error unchanged when it has a different error category.
Sourcepub fn source_stack(&self) -> &[String]
pub fn source_stack(&self) -> &[String]
Return source names captured by a parser stack, from bottom to top.
Trait Implementations§
impl Eq for ScanError
Source§impl Error for ScanError
impl Error for ScanError
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<E> From<ScanError> for TryLoadError<E>
impl<E> From<ScanError> for TryLoadError<E>
impl StructuralPartialEq for ScanError
Auto Trait Implementations§
impl !RefUnwindSafe for ScanError
impl !UnwindSafe for ScanError
impl Forget for ScanError
impl Freeze for ScanErrorwhere
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
*const ArcInner<Error> is !null: Freeze,
PhantomData<ArcInner<Error>>: Freeze,
PhantomData<String>: Freeze,
impl Move for ScanError
impl Send for ScanError
impl Sync for ScanError
impl Unpin for ScanError
impl UnsafeUnpin for ScanErrorwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
*const ArcInner<Error> is !null: UnsafeUnpin,
PhantomData<ArcInner<Error>>: UnsafeUnpin,
PhantomData<String>: UnsafeUnpin,
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