pub struct ErrorAccumulator {
bad: Option<Error>,
defused: bool,
}Expand description
Contains zero or more syn::Error
§Panics
Panics if dropped.
You must call one of the consuming methods, eg finish
Fields§
§bad: Option<Error>§defused: boolImplementations§
Source§impl ErrorAccumulator
impl ErrorAccumulator
Sourcepub fn handle_in<T, F>(&mut self, f: F) -> Option<T>
pub fn handle_in<T, F>(&mut self, f: F) -> Option<T>
Run f, accumulate any error, and return an Ok
Sourcepub fn handle<T>(&mut self, result: Result<T>) -> Option<T>
pub fn handle<T>(&mut self, result: Result<T>) -> Option<T>
Handle a Result: accumulate any error, and returni an Ok
Sourcepub fn finish(self) -> Result<()>
pub fn finish(self) -> Result<()>
If there were any errors, return a single error that combines them
Sourcepub fn finish_with<T>(self, success: T) -> Result<T>
pub fn finish_with<T>(self, success: T) -> Result<T>
If there were any errors, return Err, otherwise Ok(success)
Sourcepub fn into_inner(self) -> Option<Error>
pub fn into_inner(self) -> Option<Error>
If there any errors, return a single error that combines them
Trait Implementations§
Source§impl Debug for ErrorAccumulator
impl Debug for ErrorAccumulator
Source§impl Default for ErrorAccumulator
impl Default for ErrorAccumulator
Source§fn default() -> ErrorAccumulator
fn default() -> ErrorAccumulator
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ErrorAccumulator
impl RefUnwindSafe for ErrorAccumulator
impl Send for ErrorAccumulator
impl Sync for ErrorAccumulator
impl Unpin for ErrorAccumulator
impl UnwindSafe for ErrorAccumulator
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> 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