pub struct TimeLimitRule { /* private fields */ }Expand description
Stops the search once the time limit is reached.
It also serves as the search’s clock. When made relaxable, reaching the limit ends the current pass and the clock restarts for the next one.
Implementations§
Source§impl TimeLimitRule
impl TimeLimitRule
Sourcepub fn elapsed_seconds(&self) -> f64
pub fn elapsed_seconds(&self) -> f64
Seconds since the rule was activated or reset.
Sourcepub fn remaining_seconds(&self) -> f64
pub fn remaining_seconds(&self) -> f64
Seconds left before the limit, never negative.
Trait Implementations§
Source§impl Debug for TimeLimitRule
impl Debug for TimeLimitRule
Source§impl Default for TimeLimitRule
impl Default for TimeLimitRule
Source§impl Rule for TimeLimitRule
impl Rule for TimeLimitRule
Source§fn evaluate(&self, _context: &RuleContext) -> RuleResult
fn evaluate(&self, _context: &RuleContext) -> RuleResult
Decides whether the search continues below the node.
Source§fn description(&self) -> String
fn description(&self) -> String
A short human-readable name.
Source§fn deactivate(&mut self)
fn deactivate(&mut self)
Stops applying the rule.
Source§fn is_relaxable(&self) -> bool
fn is_relaxable(&self) -> bool
Whether the rule restricts the search only temporarily. A search whose
pass was cut by a relaxable rule is not finished.
Source§fn relax(&mut self)
fn relax(&mut self)
Widens the rule’s budget before the next pass, or deactivates it once
the budget is at its limit.
Source§fn as_any(&self) -> &dyn Any
fn as_any(&self) -> &dyn Any
Upcast used by
RuleManager::get_rule_mut.Source§fn as_any_mut(&mut self) -> &mut dyn Any
fn as_any_mut(&mut self) -> &mut dyn Any
Mutable upcast used by
RuleManager::get_rule_mut.Auto Trait Implementations§
impl Freeze for TimeLimitRule
impl RefUnwindSafe for TimeLimitRule
impl Send for TimeLimitRule
impl Sync for TimeLimitRule
impl Unpin for TimeLimitRule
impl UnsafeUnpin for TimeLimitRule
impl UnwindSafe for TimeLimitRule
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