pub struct Context { /* private fields */ }Expand description
Ordered set of specs grouped into LemmaSpecSets by name.
Specs with the same name are ordered by effective_from. A spec’s temporal end is derived from the next spec’s effective_from, or +inf.
Implementations§
Source§impl Context
impl Context
pub fn new() -> Self
Sourcepub fn spec_sets(&self) -> &BTreeMap<String, LemmaSpecSet>
pub fn spec_sets(&self) -> &BTreeMap<String, LemmaSpecSet>
All spec sets (name → specs keyed by effective_from), ordered by spec name.
pub fn iter(&self) -> impl Iterator<Item = Arc<LemmaSpec>> + '_
Sourcepub fn iter_with_ranges(
&self,
) -> impl Iterator<Item = (Arc<LemmaSpec>, Option<DateTimeValue>, Option<DateTimeValue>)> + '_
pub fn iter_with_ranges( &self, ) -> impl Iterator<Item = (Arc<LemmaSpec>, Option<DateTimeValue>, Option<DateTimeValue>)> + '_
Every loaded spec paired with its half-open
[effective_from, effective_to) validity range.
Iteration order: spec name ascending, then by effective_from ascending
within the same name — identical to Self::iter. Each tuple is
(spec, effective_from, effective_to); see
crate::planning::LemmaSpecSet::iter_with_ranges for the range
semantics (the last row of each name has effective_to = None).
Sourcepub fn insert_spec(
&mut self,
spec: Arc<LemmaSpec>,
from_registry: bool,
) -> Result<(), Error>
pub fn insert_spec( &mut self, spec: Arc<LemmaSpec>, from_registry: bool, ) -> Result<(), Error>
Insert a spec. Set from_registry to true for pre-fetched registry
specs; false rejects @-prefixed spec definitions.
When from_registry is true, only @-prefixed specs are accepted —
registry bundles must not introduce bare-named specs into the local namespace.
pub fn remove_spec(&mut self, spec: &Arc<LemmaSpec>) -> bool
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Context
impl RefUnwindSafe for Context
impl Send for Context
impl Sync for Context
impl Unpin for Context
impl UnsafeUnpin for Context
impl UnwindSafe for Context
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
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>
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>
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