pub struct ConfigErrorCollector { /* private fields */ }Expand description
Collects configuration validation errors.
Implementations§
Source§impl ConfigErrorCollector
impl ConfigErrorCollector
Sourcepub fn with_capacity(capacity: usize) -> Self
pub fn with_capacity(capacity: usize) -> Self
Creates an empty collector with capacity for capacity errors.
Sourcepub fn errors(&self) -> &[ConfigError]
pub fn errors(&self) -> &[ConfigError]
Returns the collected errors.
Sourcepub fn push(&mut self, error: ConfigError)
pub fn push(&mut self, error: ConfigError)
Adds an error to the collection.
Sourcepub fn check(&mut self, condition: bool, error: ConfigError)
pub fn check(&mut self, condition: bool, error: ConfigError)
Adds error when condition is false.
Sourcepub fn collect(&mut self, result: ConfigResult<()>)
pub fn collect(&mut self, result: ConfigResult<()>)
Adds the error from a validation result.
Sourcepub fn into_result(self) -> ConfigResult<()>
pub fn into_result(self) -> ConfigResult<()>
Converts the collection to a validation result.
§Errors
Returns the collected error, or a ConfigError::Multiple when more than one error
was collected.
Trait Implementations§
Source§impl Clone for ConfigErrorCollector
impl Clone for ConfigErrorCollector
Source§fn clone(&self) -> ConfigErrorCollector
fn clone(&self) -> ConfigErrorCollector
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 ConfigErrorCollector
impl Debug for ConfigErrorCollector
Source§impl Default for ConfigErrorCollector
impl Default for ConfigErrorCollector
Source§fn default() -> ConfigErrorCollector
fn default() -> ConfigErrorCollector
Returns the “default value” for a type. Read more
impl Eq for ConfigErrorCollector
Source§impl PartialEq for ConfigErrorCollector
impl PartialEq for ConfigErrorCollector
Source§fn eq(&self, other: &ConfigErrorCollector) -> bool
fn eq(&self, other: &ConfigErrorCollector) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for ConfigErrorCollector
Auto Trait Implementations§
impl Freeze for ConfigErrorCollector
impl RefUnwindSafe for ConfigErrorCollector
impl Send for ConfigErrorCollector
impl Sync for ConfigErrorCollector
impl Unpin for ConfigErrorCollector
impl UnsafeUnpin for ConfigErrorCollector
impl UnwindSafe for ConfigErrorCollector
Blanket Implementations§
impl<T> Allocation for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more