Struct tfm::pl::ParseWarning
source · pub struct ParseWarning {
pub span: Range<usize>,
pub knuth_pltotf_offset: Option<usize>,
pub kind: ParseWarningKind,
}
Expand description
Warning generated while parsing a property list file.
Fields§
§span: Range<usize>
Location of the part of the property list file that generates this warning.
The span is in number of Unicode code points, not bytes.
knuth_pltotf_offset: Option<usize>
Point in the file that Knuth’s pltotf flags as problematic.
Most warnings in pltotf are printed with a context line. This looks like this:
PARAMETER index must not be zero (line 9).
(PARAMETER D 0
D 5)
The context line is printed over 2 lines in the terminal, with the break occurring at the part of the line that triggered the warning.
This field gives the offset of the break within the entire file.
The offset is in number of Unicode code points, not bytes.
For warnings that don’t have a context line (like next larger warnings)
this field has a value of None
.
kind: ParseWarningKind
Kind of the warning.
Implementations§
source§impl ParseWarning
impl ParseWarning
pub fn pltotf_message(&self, pl_source: &str) -> String
source§impl ParseWarning
impl ParseWarning
pub fn ariadne_report(&self) -> Report<'_>
Trait Implementations§
source§impl Clone for ParseWarning
impl Clone for ParseWarning
source§fn clone(&self) -> ParseWarning
fn clone(&self) -> ParseWarning
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 ParseWarning
impl Debug for ParseWarning
source§impl PartialEq<ParseWarning> for ParseWarning
impl PartialEq<ParseWarning> for ParseWarning
source§fn eq(&self, other: &ParseWarning) -> bool
fn eq(&self, other: &ParseWarning) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Eq for ParseWarning
impl StructuralEq for ParseWarning
impl StructuralPartialEq for ParseWarning
Auto Trait Implementations§
impl RefUnwindSafe for ParseWarning
impl Send for ParseWarning
impl Sync for ParseWarning
impl Unpin for ParseWarning
impl UnwindSafe for ParseWarning
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