Skip to main content

Module write_queue

Module write_queue 

Source
Expand description

Writes held on disk for the daemon. An entry is either sealed to the device’s device.pub, keeping only its Label readable, or plaintext, as older binaries and a writer without the recipient write it.

Structs§

Entry
One queued write, as it is sent to the daemon.
Label
What a sealed entry keeps readable without the device key.

Enums§

OpenError

Constants§

DIR_NAME
The directory under the data dir where writes wait for the daemon; the MCP server, the daemon’s write gate and its replayer all use it.

Functions§

entry_name
A fresh entry name for a write made at nanos since the epoch.
is_entry_name
<19-digit unix nanos>-<uuid>.json, or .sealed; no other name in the directory is an entry, so a file still being written under a temporary name is never read.
is_sealed_name
open
Reads an entry file of either kind; a sealed one needs identity.
read_label
The label of an entry file of either kind, read without any key.
reseal_dir
Seals again, to recipients, every sealed entry in dir that old opens, so writes queued under a device key outlive it; entries old can’t open, or that can’t be read, are left as they are. Failing to write a resealed entry is an error, since the caller may be about to drop old. Returns how many it resealed.