[−][src]Struct manger::ConsumeError
A list of errors that occured while consuming from a source
.
Implementations
impl ConsumeError
[src]
pub fn new() -> ConsumeError
[src]
Create a new empty ConsumeError
.
pub fn new_with(cause: ConsumeErrorType) -> ConsumeError
[src]
Create a new ConsumeError
containing only cause
.
pub fn new_from(causes: Vec<ConsumeErrorType>) -> ConsumeError
[src]
Create a new ConsumeError
containing causes
.
pub fn offset(self, by: usize) -> Self
[src]
Mutate all the errors to move the utf-8 character index at which they were caused by by
.
Examples
use manger::{ ConsumeError, ConsumeErrorType::* }; assert_eq!( ConsumeError::new_from( vec![ InvalidValue { index: 0 }, InsufficientTokens { index: 5 } ] ).offset(2), ConsumeError::new_from( vec![ InvalidValue { index: 2 }, InsufficientTokens { index: 7 } ] ) );
pub fn into_causes(self) -> Vec<ConsumeErrorType>
[src]
Fetch a vector of the causes of this error.
This consume ownership of the error.
pub fn causes(&self) -> Vec<&ConsumeErrorType>
[src]
Fetch a vector of references to the causes of this error.
pub fn add_cause(&mut self, cause: ConsumeErrorType)
[src]
Pushes an extra cause for this error.
pub fn add_causes(&mut self, other_err: ConsumeError)
[src]
Pushes all the causes for other_err
for this error.
Trait Implementations
impl Debug for ConsumeError
[src]
impl PartialEq<ConsumeError> for ConsumeError
[src]
pub fn eq(&self, other: &ConsumeError) -> bool
[src]
pub fn ne(&self, other: &ConsumeError) -> bool
[src]
impl StructuralPartialEq for ConsumeError
[src]
Auto Trait Implementations
impl RefUnwindSafe for ConsumeError
[src]
impl Send for ConsumeError
[src]
impl Sync for ConsumeError
[src]
impl Unpin for ConsumeError
[src]
impl UnwindSafe for ConsumeError
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,