Skip to main content

MaelstromDeployment

Struct MaelstromDeployment 

Source
pub struct MaelstromDeployment {
    pub node_count: usize,
    pub maelstrom_path: PathBuf,
    pub workload: String,
    pub time_limit: Option<u64>,
    pub rate: Option<u64>,
    pub availability: Option<String>,
    pub nemesis: Option<String>,
    pub extra_args: Vec<String>,
    /* private fields */
}
Available on crate feature maelstrom only.
Expand description

The Maelstrom deployment environment.

This holds configuration for the Maelstrom run and accumulates compilation artifacts during deployment.

Fields§

§node_count: usize

Number of nodes in the cluster.

§maelstrom_path: PathBuf

Path to the maelstrom binary.

§workload: String

Workload to run (e.g., “echo”, “broadcast”, “g-counter”).

§time_limit: Option<u64>

Time limit in seconds.

§rate: Option<u64>

Rate of requests per second.

§availability: Option<String>

The availability of nodes.

§nemesis: Option<String>

Nemesis to run during tests.

§extra_args: Vec<String>

Additional maelstrom arguments.

Implementations§

Source§

impl MaelstromDeployment

Source

pub fn new(workload: impl Into<String>) -> Self

Available on crate feature deploy only.

Create a new Maelstrom deployment with the given node count.

Source

pub fn node_count(self, count: usize) -> Self

Available on crate feature deploy only.

Set the node count.

Source

pub fn maelstrom_path(self, path: impl Into<PathBuf>) -> Self

Available on crate feature deploy only.

Set the path to the maelstrom binary.

Source

pub fn time_limit(self, seconds: u64) -> Self

Available on crate feature deploy only.

Set the time limit in seconds.

Source

pub fn rate(self, rate: u64) -> Self

Available on crate feature deploy only.

Set the request rate per second.

Source

pub fn availability(self, availability: impl Into<String>) -> Self

Available on crate feature deploy only.

Set the availability for the test.

Source

pub fn nemesis(self, nemesis: impl Into<String>) -> Self

Available on crate feature deploy only.

Set the nemesis for the test.

Source

pub fn extra_args( self, args: impl IntoIterator<Item = impl Into<String>>, ) -> Self

Available on crate feature deploy only.

Add extra arguments to pass to maelstrom.

Source

pub fn build(&self) -> Result<PathBuf, Error>

Available on crate feature deploy only.

Build the compiled binary in dev mode. Returns the path to the compiled binary.

Source

pub fn run(self) -> Result<(), Error>

Available on crate feature deploy only.

Run Maelstrom with the compiled binary, return Ok(()) if all checks pass.

This will block until Maelstrom completes.

Source

pub fn binary_path(&self) -> Option<PathBuf>

Available on crate feature deploy only.

Get the path to the compiled binary (after building).

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.

§

impl<T> Instrument for T

§

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

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

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> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
§

impl<Unshared, Shared> IntoShared<Shared> for Unshared
where Shared: FromUnshared<Unshared>,

§

fn into_shared(self) -> Shared

Creates a shared type from an unshared type.
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToSinkBuild for T

Source§

fn iter_to_sink_build(self) -> SendIterBuild<Self>
where Self: Sized + Iterator,

Starts a SinkBuild adaptor chain to send all items from self as an Iterator.
Source§

fn stream_to_sink_build(self) -> SendStreamBuild<Self>
where Self: Sized + Stream,

Starts a SinkBuild adaptor chain to send all items from self as a [Stream].
Source§

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

Source§

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>,

Source§

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.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

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
§

fn with_current_subscriber(self) -> WithDispatch<Self>

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