pub struct LemmaSpec {
pub name: String,
pub effective_from: EffectiveDate,
pub source_type: Option<SourceType>,
pub start_line: usize,
pub commentary: Option<String>,
pub data: Vec<LemmaData>,
pub rules: Vec<LemmaRule>,
pub meta_fields: Vec<MetaField>,
}Expand description
A Lemma spec containing data and rules.
name is always the bare spec set name (no @, no dots, no slashes). The
owning repository — and, transitively, whether the spec is loaded from a registry
bundle — is preserved through the structural relationship in
crate::engine::Context, not via fields on this structure.
LemmaSpec has no global identity. There is no PartialEq, Eq, Ord,
or Hash implementation. Consumers must either:
- compare
Arc<LemmaSpec>by pointer withArc::ptr_eq(valid within a singleContext), or - key by the explicit composite
(Arc<LemmaRepository>, name, EffectiveDate)triple.
Fields§
§name: String§effective_from: EffectiveDate§source_type: Option<SourceType>§start_line: usize§commentary: Option<String>§data: Vec<LemmaData>§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. Origin (None) means −∞.
pub fn with_source_type(self, source_type: SourceType) -> Self
pub fn with_start_line(self, start_line: usize) -> Self
pub fn set_commentary(self, commentary: String) -> Self
pub fn add_data(self, data: LemmaData) -> Self
pub fn add_rule(self, rule: LemmaRule) -> 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
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<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 more