Struct loom::model::Builder

source ·
#[non_exhaustive]
pub struct Builder { pub max_threads: usize, pub max_branches: usize, pub max_permutations: Option<usize>, pub max_duration: Option<Duration>, pub preemption_bound: Option<usize>, pub checkpoint_file: Option<PathBuf>, pub checkpoint_interval: usize, pub expect_explicit_explore: bool, pub location: bool, pub log: bool, }
Expand description

Configure a model

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§max_threads: usize

Max number of threads to check as part of the execution.

This should be set as low as possible and must be less than MAX_THREADS.

§max_branches: usize

Maximum number of thread switches per permutation.

Defaults to LOOM_MAX_BRANCHES environment variable.

§max_permutations: Option<usize>

Maximum number of permutations to explore.

Defaults to LOOM_MAX_PERMUTATIONS environment variable.

§max_duration: Option<Duration>

Maximum amount of time to spend on checking

Defaults to LOOM_MAX_DURATION environment variable.

§preemption_bound: Option<usize>

Maximum number of thread preemptions to explore

Defaults to LOOM_MAX_PREEMPTIONS environment variable.

§checkpoint_file: Option<PathBuf>

When doing an exhaustive check, uses the file to store and load the check progress

Defaults to LOOM_CHECKPOINT_FILE environment variable.

§checkpoint_interval: usize

How often to write the checkpoint file

Defaults to LOOM_CHECKPOINT_INTERVAL environment variable.

§expect_explicit_explore: bool

When true loom won’t start state exploration until explore_state is called.

§location: bool

When true, locations are captured on each loom operation.

Note that is is very expensive. It is recommended to first isolate a failing iteration using LOOM_CHECKPOINT_FILE, then enable location tracking.

Defaults to LOOM_LOCATION environment variable.

§log: bool

Log execution output to stdout.

Defaults to existence of LOOM_LOG environment variable.

Implementations§

source§

impl Builder

source

pub fn new() -> Builder

Create a new Builder instance with default values.

source

pub fn checkpoint_file(&mut self, file: &str) -> &mut Self

Set the checkpoint file.

source

pub fn check<F>(&self, f: F)
where F: Fn() + Sync + Send + 'static,

Check the provided model.

Trait Implementations§

source§

impl Debug for Builder

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for Builder

source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more