pub struct ErrorCollector {
pub errors: Vec<PhysicsError>,
pub max_errors: usize,
}Expand description
Collect multiple errors during a batch operation.
Fields§
§errors: Vec<PhysicsError>Collected errors.
max_errors: usizeMaximum number of errors to collect before stopping.
Implementations§
Source§impl ErrorCollector
impl ErrorCollector
Sourcepub fn with_limit(max: usize) -> Self
pub fn with_limit(max: usize) -> Self
Create a collector with a specific max error limit.
Sourcepub fn push(&mut self, error: PhysicsError) -> bool
pub fn push(&mut self, error: PhysicsError) -> bool
Add an error. Returns true if the error limit has been reached.
Sourcepub fn has_errors(&self) -> bool
pub fn has_errors(&self) -> bool
Returns true if any errors were collected.
Sourcepub fn drain(&mut self) -> Vec<PhysicsError>
pub fn drain(&mut self) -> Vec<PhysicsError>
Drain all errors, returning them.
Sourcepub fn into_result(self) -> PhysicsResult<()>
pub fn into_result(self) -> PhysicsResult<()>
Convert into a result: Ok if no errors, Err with first error otherwise.
Trait Implementations§
Source§impl Clone for ErrorCollector
impl Clone for ErrorCollector
Source§fn clone(&self) -> ErrorCollector
fn clone(&self) -> ErrorCollector
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ErrorCollector
impl Debug for ErrorCollector
Source§impl Default for ErrorCollector
impl Default for ErrorCollector
Source§fn default() -> ErrorCollector
fn default() -> ErrorCollector
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ErrorCollector
impl RefUnwindSafe for ErrorCollector
impl Send for ErrorCollector
impl Sync for ErrorCollector
impl Unpin for ErrorCollector
impl UnsafeUnpin for ErrorCollector
impl UnwindSafe for ErrorCollector
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<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.