pub struct RuleBook {
pub rules: Vec<CompiledRule>,
pub problems: Vec<RuleProblem>,
}Expand description
The rules of the inbox, read and compiled.
Fields§
§rules: Vec<CompiledRule>§problems: Vec<RuleProblem>Implementations§
Source§impl RuleBook
impl RuleBook
Sourcepub fn compile(values: &[Value], priorities: &[(String, i32)]) -> RuleBook
pub fn compile(values: &[Value], priorities: &[(String, i32)]) -> RuleBook
Reads the rules, resolving priority names against priorities.
Priority names are the instance’s own, so they are looked up among the priorities the inbox has seen. A name not among them leaves its rule dormant - matching nothing - rather than failing: “Highest” may simply not have been assigned to anyone yet.
Sourcepub fn of_inbox(config: &JiraInboxConfig, db: &JiraInbox) -> Result<RuleBook>
pub fn of_inbox(config: &JiraInboxConfig, db: &JiraInbox) -> Result<RuleBook>
The rules of the configured inbox, against the priorities it has seen.
Sourcepub fn from_config(db: &JiraInbox) -> Result<RuleBook>
pub fn from_config(db: &JiraInbox) -> Result<RuleBook>
The rules as the config on disk has them; none when it cannot be read.
Sourcepub fn verdict(&self, item: &JiraInboxItem) -> Verdict
pub fn verdict(&self, item: &JiraInboxItem) -> Verdict
What every rule the issue matches says about it now.
Sourcepub fn entering(
&self,
before: Option<&JiraInboxItem>,
now: &JiraInboxItem,
) -> Verdict
pub fn entering( &self, before: Option<&JiraInboxItem>, now: &JiraInboxItem, ) -> Verdict
What the rules the issue has just come to match say about it.
A rule counts when the issue matches it now and did not before - or there was no before, because the issue is new.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for RuleBook
impl RefUnwindSafe for RuleBook
impl Send for RuleBook
impl Sync for RuleBook
impl Unpin for RuleBook
impl UnsafeUnpin for RuleBook
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