pub struct SocketEndpoint { /* private fields */ }Expand description
The owner tree’s local socket: the path v2 binds, the canonical spelling v1 bound, the registration that names it, and the root all three derive from.
resolve touches no filesystem, so a client that starts
before its daemon still resolves the one path the daemon will bind, and an
absent runtime directory is not an error until a caller binds or publishes.
Implementations§
Source§impl SocketEndpoint
impl SocketEndpoint
Sourcepub fn resolve(root: &Path, run_dir: &Path) -> Self
pub fn resolve(root: &Path, run_dir: &Path) -> Self
Resolve from the owner root and its runtime directory
(<root>/.onlyne/run).
The digest covers absolute_path of root, so the spelling has to
stop moving before a daemon and its clients can agree. A tree that exists
resolves its canonical spelling; one that does not yet own a directory
(a caller resolving before bootstrap creates it) resolves a collapsed
lexical spelling, and macOS reaches one tree through /var and
/private/var. Resolve after bootstrap when the derived name has to
match a running daemon’s.
run_dir names only natural.
Sourcepub fn natural(&self) -> &Path
pub fn natural(&self) -> &Path
The canonical v1 spelling, <run_dir>/s, kept for operators and older
tooling that print it. Nothing binds or connects here under v2.
Sourcepub fn registration(&self) -> &Path
pub fn registration(&self) -> &Path
<runtime_dir>/<digest>.json, the file naming actual.
Sourcepub fn short(&self) -> bool
pub fn short(&self) -> bool
true when the bound path is not the canonical <run_dir>/s spelling,
which under v2 is every tree unless a runtime path happens to equal it.
Callers log one line about the move.
Sourcepub fn publish(&self, reg: &RegistrationFile) -> Result<()>
pub fn publish(&self, reg: &RegistrationFile) -> Result<()>
Write reg at registration.
The caller owns the file: a role workspace writes its own kind, role, and runtime here, and the next bind overwrites whatever was there.