pub struct RuleBook { /* private fields */ }Expand description
The loaded rule packs and the source registry.
Implementations§
Source§impl RuleBook
impl RuleBook
Sourcepub fn bundled_texts() -> impl Iterator<Item = (&'static str, &'static str)>
pub fn bundled_texts() -> impl Iterator<Item = (&'static str, &'static str)>
The bundled source register and packs as (path, text), in a fixed order — for a
fingerprint of the rules a decision was made under.
Sourcepub fn bundled() -> Result<Self, Vec<RuleProblem>>
pub fn bundled() -> Result<Self, Vec<RuleProblem>>
The rule packs shipped in rules/.
§Errors
Every problem in the bundled packs (a release never ships with any; the gate checks).
Sourcepub fn parse(
sources: &str,
packs: &[(&str, &str)],
) -> Result<Self, Vec<RuleProblem>>
pub fn parse( sources: &str, packs: &[(&str, &str)], ) -> Result<Self, Vec<RuleProblem>>
Parses a source registry and named packs, collecting every problem.
§Errors
Unknown or incomplete sources, malformed entries, overlapping validity.
Sourcepub fn da_price_limits(
&self,
day: Date,
) -> Result<(EurPerMwh, EurPerMwh, &Entry), Missing>
pub fn da_price_limits( &self, day: Date, ) -> Result<(EurPerMwh, EurPerMwh, &Entry), Missing>
Sourcepub fn granularity(
&self,
rule: &str,
day: Date,
) -> Result<(Granularity, &Entry), Missing>
pub fn granularity( &self, rule: &str, day: Date, ) -> Result<(Granularity, &Entry), Missing>
Trait Implementations§
Auto Trait Implementations§
impl Forget for RuleBook
impl Freeze for RuleBook
impl Move for RuleBook
impl RefUnwindSafe for RuleBook
impl Send for RuleBook
impl Sync for RuleBook
impl Unpin for RuleBook
impl UnsafeUnpin for RuleBookwhere
*const LeafNode<String, Source> is !null: UnsafeUnpin,
PhantomData<(Owned, LeafOrInternal)>: UnsafeUnpin,
PhantomData<Box<(String, Source)>>: UnsafeUnpin,
*const LeafNode<String, Vec<Entry>> is !null: UnsafeUnpin,
PhantomData<Box<(String, Vec<Entry>)>>: UnsafeUnpin,
impl UnwindSafe for RuleBook
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