Crate maelstrom_base

source ·
Expand description

Core structs used by the broker, worker, and clients. Everything in this crate must be usable from wasm.

Modules§

  • Messages sent between various binaries.
  • This implements a simple ring-buffer backed by a vector that has serde support
  • Contains data-structures for maintaining historical statistics of jobs

Macros§

  • Creates a EnumSet literal, which can be used in const contexts.
  • Like the vec! macro, but enforces at least one argument. A nice short-hand for constructing NonEmpty values.

Structs§

  • ID of a client connection. These share the same ID space as WorkerId.
  • A client-relative job ID. Clients can assign these however they like.
  • An efficient set type for enums.
  • ID of a group. This should be compatible with gid_t.
  • An absolute job ID that includes a ClientId for disambiguation.
  • All necessary information for the worker to execute a job.
  • The output of a job that was successfully executed. This doesn’t mean that the client will be happy with the job’s output. Maybe the job was killed by a signal, or it exited with an error status code. From our point of view, it doesn’t matter. We ran the job until it was terminated, and gathered its output.
  • Non-empty vector.
  • A SHA-256 digest.
  • Error indicating that two digests that should have matched didn’t.
  • ID of a user. This should be compatible with uid_t.
  • An owned, mutable UTF-8 path (akin to String).
  • ID of a worker connection. These share the same ID space as ClientId.

Enums§

Type Aliases§

  • A common Result type in the worker.
  • All relevant information about the outcome of a job. This is what’s sent around between the Worker, Broker, and Client.