#[repr(C)]pub struct WebRule {
pub rule_id: WebRuleId,
pub rule_type: WebRuleType,
pub context_id: u64,
pub predicate_hash: u64,
pub min_confidence: f32,
pub required_domain: u64,
}Expand description
A validation rule applied by the WebValidator to incoming NQuins.
Fields§
§rule_id: WebRuleId§rule_type: WebRuleType§context_id: u64Context this rule applies to; 0 means all contexts.
predicate_hash: u64Predicate this rule applies to; 0 means all predicates.
min_confidence: f32§required_domain: u64Implementations§
Source§impl WebRule
impl WebRule
Sourcepub fn new(rule_id: WebRuleId, rule_type: WebRuleType) -> Self
pub fn new(rule_id: WebRuleId, rule_type: WebRuleType) -> Self
A rule matching all contexts and predicates with no confidence
floor or domain requirement — narrow it with the with_*
builders.
Sourcepub fn with_context(self, context_id: u64) -> Self
pub fn with_context(self, context_id: u64) -> Self
Restrict the rule to a single context (0 keeps it global).
Sourcepub fn with_predicate(self, predicate_hash: u64) -> Self
pub fn with_predicate(self, predicate_hash: u64) -> Self
Restrict the rule to a single predicate hash (0 matches all).
Sourcepub fn with_confidence(self, min_confidence: f32) -> Self
pub fn with_confidence(self, min_confidence: f32) -> Self
Set the minimum confidence a quin must carry for this rule.
Sourcepub fn with_domain(self, required_domain: u64) -> Self
pub fn with_domain(self, required_domain: u64) -> Self
Require quins to carry domain required_domain for this rule.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for WebRule
impl RefUnwindSafe for WebRule
impl Send for WebRule
impl Sync for WebRule
impl Unpin for WebRule
impl UnsafeUnpin for WebRule
impl UnwindSafe for WebRule
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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