pub struct RootEvent {
pub kind: RootKind,
pub content: RawContentId,
pub seq: u64,
}Expand description
A specific rooting event, addressed by its own content.
§Why seq
An operator can type “run the tests” twice in one session. Those are two
turns, and a unit rooted in the second must not be indistinguishable from
one rooted in the first. Content alone collapses them; seq is what keeps
“which turn” answerable. It is the session-local ordinal of the event, so it
is deterministic — a replay of the same session mints the same ids.
Fields§
§kind: RootKindWhat kind of event this was.
content: RawContentIdThe event’s own material — the prompt bytes, the action record, the
harness event record. A RawContentId because this is an opaque byte
string, not a canonical structured value.
seq: u64Session-local ordinal, so two identical events remain distinct.
Implementations§
Trait Implementations§
Source§impl ContentAddressable for RootEvent
impl ContentAddressable for RootEvent
Source§fn canonical_form(&self) -> Result<Vec<u8>, ContentError>
fn canonical_form(&self) -> Result<Vec<u8>, ContentError>
Produce the deterministic byte representation of this value. Read more
Source§fn content_id(&self) -> Result<ContentId, ContentError>
fn content_id(&self) -> Result<ContentId, ContentError>
Source§fn verify(&self, expected: &ContentId) -> Result<bool, ContentError>
fn verify(&self, expected: &ContentId) -> Result<bool, ContentError>
Check whether this value’s content id matches an
expected id. Read moreSource§fn ensure_content_id(&self, expected: &ContentId) -> Result<(), ContentError>
fn ensure_content_id(&self, expected: &ContentId) -> Result<(), ContentError>
Verify, returning an error on mismatch instead of
Ok(false). Read moreSource§fn from_canonical_form(bytes: &[u8]) -> Result<Self, ContentError>where
Self: Sized + DeserializeOwned,
fn from_canonical_form(bytes: &[u8]) -> Result<Self, ContentError>where
Self: Sized + DeserializeOwned,
Checked ingress: decode a value from its canonical form, proving the
bytes reproduce it — a checked partial inverse of
canonical_form. Read moreimpl Copy for RootEvent
Source§impl<'de> Deserialize<'de> for RootEvent
impl<'de> Deserialize<'de> for RootEvent
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for RootEvent
Source§impl Ord for RootEvent
impl Ord for RootEvent
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialOrd for RootEvent
impl PartialOrd for RootEvent
impl StructuralPartialEq for RootEvent
Auto Trait Implementations§
impl Freeze for RootEvent
impl RefUnwindSafe for RootEvent
impl Send for RootEvent
impl Sync for RootEvent
impl Unpin for RootEvent
impl UnsafeUnpin for RootEvent
impl UnwindSafe for RootEvent
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