pub enum Info<T, R> {
Token(T),
Range(R),
Owned(String),
Static(&'static str),
}
Expand description
Enum holding error information. Variants are defined for Stream::Token
and Stream::Range
as
well as string variants holding easy descriptions.
As there is implementations of From
for String
and &'static str
the
constructor need not be used directly as calling msg.into()
should turn a message into the
correct Info
variant.
Variants§
Implementations§
Trait Implementations§
source§impl<T, R, F> From<Info<T, R, F>> for Info<T, R>where
F: Display,
impl<T, R, F> From<Info<T, R, F>> for Info<T, R>where
F: Display,
source§fn from(info: PrimitiveInfo<T, R, F>) -> Self
fn from(info: PrimitiveInfo<T, R, F>) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl<T, R> Freeze for Info<T, R>
impl<T, R> RefUnwindSafe for Info<T, R>where
T: RefUnwindSafe,
R: RefUnwindSafe,
impl<T, R> Send for Info<T, R>
impl<T, R> Sync for Info<T, R>
impl<T, R> Unpin for Info<T, R>
impl<T, R> UnwindSafe for Info<T, R>where
T: UnwindSafe,
R: 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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)