pub struct RegistrationFile {
pub kind: RegistrationKind,
pub role: Option<String>,
pub root: PathBuf,
pub pid: u32,
pub version: String,
pub runtime: Option<String>,
pub placement: Option<String>,
}Expand description
The one file that names a workspace’s endpoint: <runtime>/<digest>.json.
It answers without touching the workspace what run/socket answered for a
path and what a state.db/client.db guess answered for a surface: who
serves this tree (kind, role), which tree it is (root), which process
(pid), which wire version, and which runtime hosts the role’s sessions
(runtime, the field external-runtime plugins match to find their clients).
The writer’s facts are the file’s facts. A bind does not publish one on its
own, because a bind does not know whether it belongs to an admin root or a
role workspace: the serving side calls write_registration or
SocketEndpoint::publish with the surface it knows.
Fields§
§kind: RegistrationKindWhich side of the socket this process serves.
role: Option<String>The role this client serves; None for a server root. null in JSON.
root: PathBufThe canonical spelling of the tree the socket belongs to.
pid: u32The pid of the process serving it, restated at every bind.
version: StringThe writer’s version, WIRE_VERSION for this crate.
runtime: Option<String>The runtime hosting the role’s sessions (pi, acp, …); None for a
server root. null in JSON.
placement: Option<String>Where this machine displays the role’s runtime process (orca, zellij,
headless, external); None for a server root, and for a client that
published its registration before it resolved one.
Placement is a property of the machine, which is why it is recorded
here: an external runtime’s plugin reads the registrations in this
directory and dials the clients whose placement says the runtime is
already resident (external).
Implementations§
Source§impl RegistrationFile
impl RegistrationFile
Sourcepub fn client(root: &Path) -> Self
pub fn client(root: &Path) -> Self
This process serving root as a role workspace’s client daemon.
Sourcepub fn new(kind: RegistrationKind, root: &Path) -> Self
pub fn new(kind: RegistrationKind, root: &Path) -> Self
This process, WIRE_VERSION, canonical root, no role, no runtime.
Sourcepub fn with_role(self, role: impl Into<String>) -> Self
pub fn with_role(self, role: impl Into<String>) -> Self
Name the role this registration serves.
Sourcepub fn with_runtime(self, runtime: impl Into<String>) -> Self
pub fn with_runtime(self, runtime: impl Into<String>) -> Self
Name the runtime hosting the role’s sessions.
Sourcepub fn with_placement(self, placement: impl Into<String>) -> Self
pub fn with_placement(self, placement: impl Into<String>) -> Self
Name the placement this machine displays the role’s sessions in.