Trait client_side_validation::SealResolver
source · pub trait SealResolver<Seal> {
type Error: SealIssue<Seal = Seal>;
// Required method
fn resolve_trust(&mut self, seal: &Seal) -> Result<(), Self::Error>;
}
Expand description
Seal resolver validates seal to have closed
status, or reports
SealResolver::Error
otherwise, if the seal does not have a determined
status or there was a error accessing seal commitment medium. The reported
error does not necessary implies that the seal is not closed and the final
decision about seal status must be solved at upper protocol levels or by a
informed user action.
Seal resolution MUST always produce a singular success type (defined by
()
) or fail with a well-defined type of SealResolver::Error
.
Seal resolver may have an internal state (represented by self
reference)
and it does not require to produce a deterministic result for the same
given data piece and context: the seal resolver may depend on previous
operation history and depend on type and other external parameters.
Required Associated Types§
sourcetype Error: SealIssue<Seal = Seal>
type Error: SealIssue<Seal = Seal>
Error type returned by SealResolver::resolve_trust
, which should
cover both errors in accessing single-use-seal medium (like network
connectivity) or evidences of the facts the seal was not (yet) closed.
Required Methods§
sourcefn resolve_trust(&mut self, seal: &Seal) -> Result<(), Self::Error>
fn resolve_trust(&mut self, seal: &Seal) -> Result<(), Self::Error>
Resolves trust to the provided single-use-seal.
The method mutates resolver such that it can be able to store cached data from a single-use-seal medium.
Method must fail on both errors in accessing single-use-seal medium (like network connectivity) or if the seal is not (yet) closed.