pub struct MemoryScope(/* private fields */);Expand description
What a memory is about.
A scope is the thing memory is organised around — for this engine a working session, for a host that keeps memory of its own something else. It is a validated string rather than a ceremony id because the engine writing memory and the memory itself do not have to agree on what the world is made of, only on how to name a corner of it.
§The grammar
scope := kind ":" name
kind := one or more of [a-z0-9_-]
name := non-empty, no control characters, colons allowedwith the whole thing trimmed and at most 256 characters.
The kind is required, and it is the difference between a memory and
a collision. A scope stopped being derived from the session the
moment a definition could declare one: two hosts naming their
scopes for the things they care about — cases, tickets, teams —
share one memory with no way to tell whose entry is whose unless
each name says what kind of thing it is about. ceremony:{id}
already worked that way; this makes it the rule rather than the
habit of the one caller that formed a scope.
The name may itself contain colons, because a ceremony id may.
Implementations§
Source§impl MemoryScope
impl MemoryScope
pub fn new(raw: impl Into<String>) -> Result<Self, DomainError>
Sourcepub fn of_ceremony(ceremony_id: &CeremonyId) -> Result<Self, DomainError>
pub fn of_ceremony(ceremony_id: &CeremonyId) -> Result<Self, DomainError>
The scope a working session’s memory belongs to when the definition declares none.
One session, one scope, which means nothing is shared with any other: this is what “no shared memory” looks like, and a ceremony that wants a memory a later one can read declares the scope it wants.