pub enum Info<T, R> {
Token(T),
Range(R),
Owned(String),
Borrowed(&'static str),
}
Expand description
Enum holding error information. Variants are defined for Stream::Item
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> From<Info<T, R>> for Info<T, R>
impl<T, R> From<Info<T, R>> for Info<T, R>
Source§fn from(info: PrimitiveInfo<T, R>) -> Self
fn from(info: PrimitiveInfo<T, R>) -> 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§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more