pub struct Refusal { /* private fields */ }Available on crate features
json or toml or yaml only.Expand description
Why a Format::read refused a text, and where.
Implementations§
Source§impl Refusal
impl Refusal
Sourcepub fn new(
fault: Fault,
span: Option<Range<usize>>,
defined_at: Option<Range<usize>>,
) -> Self
pub fn new( fault: Fault, span: Option<Range<usize>>, defined_at: Option<Range<usize>>, ) -> Self
A refusal for fault, at span when the format knows where.
defined_at is set when the fault arose in a node an alias replayed:
span is then the alias, and defined_at where the node is written.
Sourcepub fn span(&self) -> Option<Range<usize>>
pub fn span(&self) -> Option<Range<usize>>
The bytes of the text the fault is at, when known. A fault the parser places only by line and column, such as a YAML scanner error, has an empty span at that place.
Sourcepub fn defined_at(&self) -> Option<Range<usize>>
pub fn defined_at(&self) -> Option<Range<usize>>
Where the node an alias replayed is written, when the fault arose in one.
Trait Implementations§
Source§impl Display for Refusal
The wording set_messages installed, or the English
default.
impl Display for Refusal
The wording set_messages installed, or the English
default.
impl Eq for Refusal
Source§impl Error for Refusal
impl Error for Refusal
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()
impl StructuralPartialEq for Refusal
Auto Trait Implementations§
impl Forget for Refusal
impl Freeze for Refusal
impl Move for Refusal
impl RefUnwindSafe for Refusal
impl Send for Refusal
impl Sync for Refusal
impl Unpin for Refusal
impl UnsafeUnpin for Refusal
impl UnwindSafe for Refusal
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T, O> Matches<O> for Twhere
T: PartialEq<O>,
impl<T, O> Matches<O> for Twhere
T: PartialEq<O>,
fn validate_matches(&self, other: &O) -> bool
Source§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
Source§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
Fallible version of
ToCompactString::to_compact_string() Read moreSource§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
Converts the given value to a
CompactString. Read more