pub struct WebValidator { /* private fields */ }Expand description
Validates NQuins against a set of WebRules before Q42 append.
Implementations§
Source§impl WebValidator
impl WebValidator
pub fn new() -> Self
pub fn set_confidence_threshold(&mut self, threshold: f32)
pub fn add_rule(&mut self, rule: WebRule)
Sourcepub fn needs_validation(&self, quin: &NQuin) -> bool
pub fn needs_validation(&self, quin: &NQuin) -> bool
Returns false when no rules apply, allowing the fast-path to the Q42
append buffer without invoking the full validator.
Sourcepub fn validate(&self, quin: &NQuin) -> WebVerdict
pub fn validate(&self, quin: &NQuin) -> WebVerdict
Validate a NQuin against all active rules.
Sourcepub fn validate_embedded_triple(
&self,
virtual_id: u64,
components: &[u64; 3],
context_id: u64,
) -> WebVerdict
pub fn validate_embedded_triple( &self, virtual_id: u64, components: &[u64; 3], context_id: u64, ) -> WebVerdict
Validate an embedded triple (Virtual ID).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for WebValidator
impl RefUnwindSafe for WebValidator
impl Send for WebValidator
impl Sync for WebValidator
impl Unpin for WebValidator
impl UnsafeUnpin for WebValidator
impl UnwindSafe for WebValidator
Blanket Implementations§
§impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
Aggregate shares in an MPC protocol.
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<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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§impl<T> NoneValue for Twhere
T: Default,
impl<T> NoneValue for Twhere
T: Default,
type NoneType = T
§fn null_value() -> T
fn null_value() -> T
The none-equivalent value.