Struct typedb_driver::logic::Rule
source · pub struct Rule {
pub label: String,
pub when: Conjunction,
pub then: ThingStatement,
}
Expand description
Rules are a part of schema and define embedded logic. The reasoning engine uses rules as a set of logic to infer new data. A rule consists of a condition and a conclusion, and is uniquely identified by a label.
Fields§
§label: String
The unique label of the rule.
when: Conjunction
The statements that constitute the ‘when’ of the rule.
then: ThingStatement
The single statement that constitutes the ‘then’ of the rule.
Trait Implementations§
source§impl PartialEq for Rule
impl PartialEq for Rule
source§impl RuleAPI for Rule
impl RuleAPI for Rule
source§fn delete<'tx>(
&mut self,
transaction: &'tx Transaction<'tx>
) -> BoxPromise<'tx, Result>
fn delete<'tx>( &mut self, transaction: &'tx Transaction<'tx> ) -> BoxPromise<'tx, Result>
Deletes this rule. Read more
source§fn set_label<'tx>(
&mut self,
transaction: &'tx Transaction<'tx>,
new_label: String
) -> BoxPromise<'tx, Result>
fn set_label<'tx>( &mut self, transaction: &'tx Transaction<'tx>, new_label: String ) -> BoxPromise<'tx, Result>
Renames the label of the rule. The new label must remain unique. Read more
source§fn is_deleted<'tx>(
&self,
transaction: &'tx Transaction<'tx>
) -> BoxPromise<'tx, Result<bool>>
fn is_deleted<'tx>( &self, transaction: &'tx Transaction<'tx> ) -> BoxPromise<'tx, Result<bool>>
Check if this rule has been deleted. Read more
impl StructuralPartialEq for Rule
Auto Trait Implementations§
impl RefUnwindSafe for Rule
impl Send for Rule
impl Sync for Rule
impl Unpin for Rule
impl UnwindSafe for Rule
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
§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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T
in a tonic::Request