pub struct ArgResult<T> {
pub value: Option<T>,
pub errors: Vec<Error>,
pub location: Span,
}
Expand description
A result type that can contain multiple errors and a value at the same time.
Fields§
§value: Option<T>
§errors: Vec<Error>
§location: Span
Implementations§
Source§impl<T> ArgResult<T>
impl<T> ArgResult<T>
pub fn new(location: Span) -> Self
Sourcepub fn add_result(&mut self, value: Result<T, ErrorMsg>)
pub fn add_result(&mut self, value: Result<T, ErrorMsg>)
Adds a value or an error that uses the stored Span depending on the result variant.
pub fn is_found(&self) -> bool
pub fn found_with_errors(&self) -> bool
pub fn found_with_value(&self) -> bool
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for ArgResult<T>where
T: Freeze,
impl<T> RefUnwindSafe for ArgResult<T>where
T: RefUnwindSafe,
impl<T> !Send for ArgResult<T>
impl<T> !Sync for ArgResult<T>
impl<T> Unpin for ArgResult<T>where
T: Unpin,
impl<T> UnwindSafe for ArgResult<T>where
T: 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