pub struct Envelope {
pub ts: String,
pub head: String,
pub branch: String,
pub by: String,
pub session: Option<String>,
}Expand description
The computed half of a ledger line: what the writer knows and the event does not.
Every field here is computed and never authored, exactly as share/events.yaml says.
It is passed in rather than gathered here, because a domain that shells out to git
while holding the ledger’s lock holds it for a hundred milliseconds on a loaded machine.
use majordomus_cli::session::Envelope;
let envelope = Envelope {
ts: "2026-09-11T11:02:35Z".into(), head: "1a651e64".into(),
branch: "master".into(), by: "majordomus/0.5.0".into(),
session: Some("s-20260910205542-e2a6".into()),
};
// a line carrying no session belongs to no episode, which is an answer and not a gap
assert!(envelope.session.is_some());Fields§
§ts: StringWhen, RFC 3339 in UTC.
head: StringThe commit the writer was on.
branch: StringThe branch it was on.
by: StringThe writer, majordomus/<version>.
session: Option<String>The episode this line belongs to, when one is open. A line carrying no session id belongs to no episode, and that is the correct answer rather than a gap: work done outside an episode is attributed to nobody rather than to whoever had one open nearby.
Trait Implementations§
impl Eq for Envelope
impl StructuralPartialEq for Envelope
Auto Trait Implementations§
impl Freeze for Envelope
impl RefUnwindSafe for Envelope
impl Send for Envelope
impl Sync for Envelope
impl Unpin for Envelope
impl UnsafeUnpin for Envelope
impl UnwindSafe for Envelope
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.