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 constructingNonEmpty
values.
Structs§
- 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.
- The outcome of a completed job. That is, a job that ran to completion, instead of timing out, being canceled, etc.
- An iterator over the variants of JobDevice
- The output and duration of a job that ran for some amount of time. This is generated regardless of how the job terminated. From our point of view, it doesn’t matter. We ran the job until it was terminated, and gathered its output.
- An absolute job ID that includes a
ClientId
for disambiguation. - All necessary information for the worker to execute a job.
- The parameters for a TTY for a job.
- Non-empty vector.
- A SHA-256 digest.
- Error indicating that two digests that should have matched didn’t.
- A count of seconds.
- ID of a user. This should be compatible with uid_t.
- A slice of a UTF-8 path (akin to
str
). - An owned, mutable UTF-8 path (akin to
String
). - The size of a terminal in characters.
Enums§
- A job failed to execute for some reason. We separate the universe of errors into “execution” errors and “system” errors.
- The outcome of a job. This doesn’t include error outcomes, which are handled with JobError.
- The result for stdout or stderr for a job.
- How a job’s process terminated. A process can either exit of its own accord or be killed by a signal.
- A single component of a path.
Type Aliases§
- All relevant information about the outcome of a job. This is what’s sent around between the Worker, Broker, and Client.
- A common Result type in the worker.