pub struct StringParseContext<B: Backing> {
pub position: usize,
pub backing: B,
}Expand description
A context for a parse error: the document (“backing”) and position in it. Unlike ParseableStr, owns the Backing, and does not contain the parsing window.
Fields§
§position: usize§backing: BTrait Implementations§
Source§impl<'r, 's, B: Backing> From<&'r ParseableStr<'s, B>> for StringParseContext<&'s B>
impl<'r, 's, B: Backing> From<&'r ParseableStr<'s, B>> for StringParseContext<&'s B>
Source§fn from(value: &'r ParseableStr<'s, B>) -> Self
fn from(value: &'r ParseableStr<'s, B>) -> Self
Converts to this type from the input type.
Source§impl<'s, B: Backing> From<ParseableStr<'s, B>> for StringParseContext<&'s B>
impl<'s, B: Backing> From<ParseableStr<'s, B>> for StringParseContext<&'s B>
Source§fn from(value: ParseableStr<'s, B>) -> Self
fn from(value: ParseableStr<'s, B>) -> Self
Converts to this type from the input type.
Source§impl<'t, B: Backing> IntoOwningBacking<<B as ToOwned>::Owned> for StringParseContext<&'t B>
impl<'t, B: Backing> IntoOwningBacking<<B as ToOwned>::Owned> for StringParseContext<&'t B>
type Owning = StringParseContext<<B as ToOwned>::Owned>
fn into_owning_backing(self) -> Self::Owning
Source§impl<B: Backing> ParseContext for StringParseContext<B>
impl<B: Backing> ParseContext for StringParseContext<B>
Source§fn show_context(&self, out: &mut String)
fn show_context(&self, out: &mut String)
Shows the error with the context in the original string.
original_input must be the original string on which this
error is based (so that position matches up).Source§impl<B: Backing> PartialEq for StringParseContext<B>
impl<B: Backing> PartialEq for StringParseContext<B>
Auto Trait Implementations§
impl<B> Freeze for StringParseContext<B>where
B: Freeze,
impl<B> RefUnwindSafe for StringParseContext<B>where
B: RefUnwindSafe,
impl<B> Send for StringParseContext<B>where
B: Send,
impl<B> Sync for StringParseContext<B>where
B: Sync,
impl<B> Unpin for StringParseContext<B>where
B: Unpin,
impl<B> UnwindSafe for StringParseContext<B>where
B: UnwindSafe,
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