pub struct LemmaSpec {
pub name: String,
pub effective_from: Option<DateTimeValue>,
pub attribute: Option<String>,
pub start_line: usize,
pub commentary: Option<String>,
pub types: Vec<TypeDef>,
pub facts: Vec<LemmaFact>,
pub rules: Vec<LemmaRule>,
pub meta_fields: Vec<MetaField>,
}Expand description
A Lemma spec containing facts and rules.
Ordered and compared by (name, effective_from) for use in BTreeSet; None < Some(_) for Option
Fields§
§name: StringBase spec name.
effective_from: Option<DateTimeValue>§attribute: Option<String>§start_line: usize§commentary: Option<String>§types: Vec<TypeDef>§facts: Vec<LemmaFact>§rules: Vec<LemmaRule>§meta_fields: Vec<MetaField>Implementations§
Source§impl LemmaSpec
impl LemmaSpec
pub fn new(name: String) -> Self
Sourcepub fn effective_from(&self) -> Option<&DateTimeValue>
pub fn effective_from(&self) -> Option<&DateTimeValue>
Temporal range start. None means −∞.
pub fn with_attribute(self, attribute: String) -> Self
pub fn with_start_line(self, start_line: usize) -> Self
pub fn set_commentary(self, commentary: String) -> Self
pub fn add_fact(self, fact: LemmaFact) -> Self
pub fn add_rule(self, rule: LemmaRule) -> Self
pub fn add_type(self, type_def: TypeDef) -> Self
pub fn add_meta_field(self, meta: MetaField) -> Self
Trait Implementations§
Source§impl<'de> Deserialize<'de> for LemmaSpec
impl<'de> Deserialize<'de> for LemmaSpec
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Ord for LemmaSpec
impl Ord for LemmaSpec
Source§impl PartialOrd for LemmaSpec
impl PartialOrd for LemmaSpec
impl Eq for LemmaSpec
Auto Trait Implementations§
impl Freeze for LemmaSpec
impl RefUnwindSafe for LemmaSpec
impl Send for LemmaSpec
impl Sync for LemmaSpec
impl Unpin for LemmaSpec
impl UnsafeUnpin for LemmaSpec
impl UnwindSafe for LemmaSpec
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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 moreSource§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.