pub struct Validator { /* private fields */ }Expand description
Validates namespace hosts against their own sites and records the outcome in a store.
Implementations§
Source§impl Validator
impl Validator
Sourcepub fn new(client: Client, own: Vec<String>) -> Validator
pub fn new(client: Client, own: Vec<String>) -> Validator
A validator fetching with client (its peers map https://<host> to where a host
answers; its allowed-host list, if any, applies), skipping own, the hosts this mesh
owns.
Sourcepub fn validate(
&self,
store: &dyn Store,
host: &str,
now: &str,
) -> Result<Validation, StoreError>
pub fn validate( &self, store: &dyn Store, host: &str, now: &str, ) -> Result<Validation, StoreError>
Validates host at now (an instant, not earlier than what the store recorded for
it) and records the outcome as the module documentation says.
Errors are the store’s: a host that is not a DNS name, an instant earlier than the
latest check, a database failure. A failed validation is a Validation, not an error.
Sourcepub fn validate_all(
&self,
store: &dyn Store,
now: &str,
) -> Result<Vec<Validation>, StoreError>
pub fn validate_all( &self, store: &dyn Store, now: &str, ) -> Result<Vec<Validation>, StoreError>
Validates every namespace in the store, by host, at now: validate
for each (the mesh’s own are Outcome::Skipped).
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Validator
impl !UnwindSafe for Validator
impl Forget for Validator
impl Freeze for Validatorwhere
*const ArcInner<Inner> is !null: Freeze,
PhantomData<ArcInner<Inner>>: Freeze,
*const u8 is !null: Freeze,
PhantomData<String>: Freeze,
impl Move for Validator
impl Send for Validator
impl Sync for Validator
impl Unpin for Validator
impl UnsafeUnpin for Validatorwhere
*const ArcInner<Inner> is !null: UnsafeUnpin,
PhantomData<ArcInner<Inner>>: UnsafeUnpin,
*const u8 is !null: UnsafeUnpin,
PhantomData<String>: UnsafeUnpin,
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