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

source

pub fn pltotf_message(&self, pl_source: &str) -> String

source§

impl ParseWarning

source

pub fn ariadne_report(&self) -> Report<'_>

Trait Implementations§

source§

impl Clone for ParseWarning

source§

fn clone(&self) -> ParseWarning

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for ParseWarning

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl PartialEq<ParseWarning> for ParseWarning

source§

fn eq(&self, other: &ParseWarning) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Eq for ParseWarning

source§

impl StructuralEq for ParseWarning

source§

impl StructuralPartialEq for ParseWarning

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.