pub struct ResourceLimits {
pub timeout: Option<Duration>,
pub max_conflicts: Option<u64>,
pub max_memory_mb: Option<u64>,
pub max_decisions: Option<u64>,
pub max_restarts: Option<u64>,
pub max_theory_checks: Option<u64>,
}Expand description
Configuration for resource limits on solver execution.
All limits are optional. When a limit is None, that resource is unlimited.
Fields§
§timeout: Option<Duration>Wall-clock timeout duration
max_conflicts: Option<u64>Maximum number of SAT conflicts before giving up
max_memory_mb: Option<u64>Maximum memory in megabytes
max_decisions: Option<u64>Maximum number of decisions before giving up
max_restarts: Option<u64>Maximum number of restarts before giving up
max_theory_checks: Option<u64>Maximum number of theory consistency checks
Implementations§
Source§impl ResourceLimits
impl ResourceLimits
Sourcepub fn with_timeout(self, timeout: Duration) -> Self
pub fn with_timeout(self, timeout: Duration) -> Self
Set a wall-clock timeout.
Sourcepub fn with_max_conflicts(self, max: u64) -> Self
pub fn with_max_conflicts(self, max: u64) -> Self
Set the maximum number of SAT conflicts.
Sourcepub fn with_max_memory_mb(self, max: u64) -> Self
pub fn with_max_memory_mb(self, max: u64) -> Self
Set the maximum memory in megabytes.
Sourcepub fn with_max_decisions(self, max: u64) -> Self
pub fn with_max_decisions(self, max: u64) -> Self
Set the maximum number of decisions.
Sourcepub fn with_max_restarts(self, max: u64) -> Self
pub fn with_max_restarts(self, max: u64) -> Self
Set the maximum number of restarts.
Sourcepub fn with_max_theory_checks(self, max: u64) -> Self
pub fn with_max_theory_checks(self, max: u64) -> Self
Set the maximum number of theory checks.
Sourcepub fn has_any_limit(&self) -> bool
pub fn has_any_limit(&self) -> bool
Check if any limits are set.
Trait Implementations§
Source§impl Clone for ResourceLimits
impl Clone for ResourceLimits
Source§fn clone(&self) -> ResourceLimits
fn clone(&self) -> ResourceLimits
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ResourceLimits
impl Debug for ResourceLimits
Source§impl Default for ResourceLimits
impl Default for ResourceLimits
Source§fn default() -> ResourceLimits
fn default() -> ResourceLimits
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ResourceLimits
impl RefUnwindSafe for ResourceLimits
impl Send for ResourceLimits
impl Sync for ResourceLimits
impl Unpin for ResourceLimits
impl UnsafeUnpin for ResourceLimits
impl UnwindSafe for ResourceLimits
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