pub struct ValidationResult {
pub total_processed: usize,
pub valid: Vec<String>,
pub errors: Vec<(String, KeyParseError)>,
}Expand description
Result of a validation operation
Fields§
§total_processed: usizeNumber of items processed before stopping
valid: Vec<String>Valid key strings
errors: Vec<(String, KeyParseError)>Invalid keys with their errors
Implementations§
Source§impl ValidationResult
impl ValidationResult
Sourcepub fn is_success(&self) -> bool
pub fn is_success(&self) -> bool
Check if all processed items were valid
Sourcepub fn valid_count(&self) -> usize
pub fn valid_count(&self) -> usize
Get the number of valid items
Sourcepub fn error_count(&self) -> usize
pub fn error_count(&self) -> usize
Get the number of invalid items
Sourcepub fn success_rate(&self) -> f64
pub fn success_rate(&self) -> f64
Get the success rate as a percentage
Sourcepub fn into_keys<T: KeyDomain>(self) -> Result<Vec<Key<T>>, KeyParseError>
pub fn into_keys<T: KeyDomain>(self) -> Result<Vec<Key<T>>, KeyParseError>
Convert all valid strings to keys
§Errors
Returns KeyParseError if any valid string fails key creation
Sourcepub fn try_into_keys<T: KeyDomain>(self) -> Vec<Key<T>>
pub fn try_into_keys<T: KeyDomain>(self) -> Vec<Key<T>>
Try to convert all valid strings to keys, ignoring failures
Trait Implementations§
Source§impl Clone for ValidationResult
impl Clone for ValidationResult
Source§fn clone(&self) -> ValidationResult
fn clone(&self) -> ValidationResult
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 ValidationResult
impl Debug for ValidationResult
impl Eq for ValidationResult
Source§impl PartialEq for ValidationResult
impl PartialEq for ValidationResult
impl StructuralPartialEq for ValidationResult
Auto Trait Implementations§
impl Freeze for ValidationResult
impl RefUnwindSafe for ValidationResult
impl Send for ValidationResult
impl Sync for ValidationResult
impl Unpin for ValidationResult
impl UnsafeUnpin for ValidationResult
impl UnwindSafe for ValidationResult
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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