pub struct Status<R>where
R: ValidationReport,{
pub seal_issues: Vec<R::SealIssue>,
pub failures: Vec<R::Failure>,
pub warnings: Vec<R::Warning>,
pub info: Vec<R::Info>,
}
Expand description
Client-side-validation status containing all reports from the validation process
Fields§
§seal_issues: Vec<R::SealIssue>
List of seal resolver reported issues (see SealIssue
trait for
details).
failures: Vec<R::Failure>
Failures generated during client-side-validation.
When the failure happens, the process of client-side-validation is not stopped and proceeds to the rest of data items, such that there might be a multiple validation failures stored in this array.
Does not include issues from single-use-seal resolution, which are
stored in Status::seal_issues
and must be handled separately.
warnings: Vec<R::Warning>
Warnings generated during client-side-validation.
Warnings are issues which does not render client-side-validated data invalid, but which should be reported to the user anyway
See also ValidationReport::Warning
.
info: Vec<R::Info>
Information reports about client-side-validation, which do not affect data safety or validity and may not be presented to the user
See also ValidationReport::Info
.
Implementations§
Source§impl<R> Status<R>where
R: ValidationReport,
impl<R> Status<R>where
R: ValidationReport,
Sourcepub fn from_failure(failure: R::Failure) -> Self
pub fn from_failure(failure: R::Failure) -> Self
Constructs status report from a single failure with the rest of log lists set to the empty state.
Sourcepub fn add_seal_issue(&mut self, seal_issue: R::SealIssue) -> &Self
pub fn add_seal_issue(&mut self, seal_issue: R::SealIssue) -> &Self
Adds a single SealIssue
to the validation report logs
Sourcepub fn add_failure(&mut self, failure: R::Failure) -> &Self
pub fn add_failure(&mut self, failure: R::Failure) -> &Self
Adds a single ValidationFailure
to the validation report logs
Sourcepub fn add_warning(&mut self, warning: R::Warning) -> &Self
pub fn add_warning(&mut self, warning: R::Warning) -> &Self
Adds a single warning entry to the validation report logs. See
ValidationReport::Warning
for more details about warnings.
Sourcepub fn add_info(&mut self, info: R::Info) -> &Self
pub fn add_info(&mut self, info: R::Info) -> &Self
Adds a single information record to the validation report logs. See
ValidationReport::Info
for more details about information log
entries.
Sourcepub fn validity(&self) -> Validity
pub fn validity(&self) -> Validity
Returns validity of the client-side data deduced from the current status containing all reported issues.
Client-side data are valid (Validity::Valid
status) only and only if
the status report contains no validation failures and seal resolution
issues.
See also Validity
for the details of possible validation statuses.
Trait Implementations§
Source§impl<R> AddAssign for Status<R>where
R: ValidationReport,
impl<R> AddAssign for Status<R>where
R: ValidationReport,
Source§fn add_assign(&mut self, rhs: Self)
fn add_assign(&mut self, rhs: Self)
+=
operation. Read moreSource§impl<'de, R> Deserialize<'de> for Status<R>where
R: ValidationReport,
impl<'de, R> Deserialize<'de> for Status<R>where
R: ValidationReport,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl<R> FromIterator<<R as ValidationReport>::Failure> for Status<R>where
R: ValidationReport,
impl<R> FromIterator<<R as ValidationReport>::Failure> for Status<R>where
R: ValidationReport,
Source§impl<R> Serialize for Status<R>where
R: ValidationReport,
impl<R> Serialize for Status<R>where
R: ValidationReport,
impl<R> Eq for Status<R>
impl<R> StructuralPartialEq for Status<R>where
R: ValidationReport,
Auto Trait Implementations§
impl<R> Freeze for Status<R>
impl<R> RefUnwindSafe for Status<R>where
<R as ValidationReport>::SealIssue: RefUnwindSafe,
<R as ValidationReport>::Failure: RefUnwindSafe,
<R as ValidationReport>::Warning: RefUnwindSafe,
<R as ValidationReport>::Info: RefUnwindSafe,
impl<R> Send for Status<R>where
<R as ValidationReport>::SealIssue: Send,
<R as ValidationReport>::Failure: Send,
<R as ValidationReport>::Warning: Send,
<R as ValidationReport>::Info: Send,
impl<R> Sync for Status<R>where
<R as ValidationReport>::SealIssue: Sync,
<R as ValidationReport>::Failure: Sync,
<R as ValidationReport>::Warning: Sync,
<R as ValidationReport>::Info: Sync,
impl<R> Unpin for Status<R>where
<R as ValidationReport>::SealIssue: Unpin,
<R as ValidationReport>::Failure: Unpin,
<R as ValidationReport>::Warning: Unpin,
<R as ValidationReport>::Info: Unpin,
impl<R> UnwindSafe for Status<R>where
<R as ValidationReport>::SealIssue: UnwindSafe,
<R as ValidationReport>::Failure: UnwindSafe,
<R as ValidationReport>::Warning: UnwindSafe,
<R as ValidationReport>::Info: 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
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§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
key
and return true
if they are equal.