pub struct Genesis {
pub program: String,
pub requested_address: Address,
pub args: Vec<String>,
pub cwd: String,
pub parent: Option<Guid>,
}Expand description
Everything a session is committed to at birth.
Three groups, one per Merkle leaf:
| leaf | fields | what it pins |
|---|---|---|
| 0 | program | the image that runs |
| 1 | requested_address, args | what the spawn asked for |
| 2 | cwd, parent | where, and under whom |
There is no field for the session’s current address — see the module docs.
Like Guid and crate::Shutai, Genesis is Serialize but
not Deserialize: it is minted from a spawn the daemon is
performing, never parsed from a payload a peer sent.
Fields§
§program: StringThe shell or program image that runs the session — the resolved
path where one is known (/run/current-system/sw/bin/zsh), the
bare name otherwise.
requested_address: AddressThe address the spawn asked for. A historical fact about the birth, not the session’s live alias; the live alias is not an input to the hash at all.
args: Vec<String>Arguments the spawn requested, in order, excluding argv[0].
cwd: StringThe working directory the session was born in.
parent: Option<Guid>The spawning session, when there was one. None is a
top-level spawn. Because a Guid can only come from a
Genesis, a parent link is unforgeable by construction: you
cannot claim a parent you never derived.
Implementations§
Source§impl Genesis
impl Genesis
Sourcepub fn new(
program: impl Into<String>,
requested_address: Address,
cwd: impl Into<String>,
) -> Self
pub fn new( program: impl Into<String>, requested_address: Address, cwd: impl Into<String>, ) -> Self
A top-level genesis: program, requested address, cwd. Add args
with Genesis::with_args and a parent with
Genesis::with_parent.
Sourcepub fn with_parent(self, parent: Guid) -> Self
pub fn with_parent(self, parent: Guid) -> Self
Record the spawning session.