pub struct Summary {
pub digest: String,
pub sessions: SessionCounts,
pub claims: ClaimCounts,
pub overlaps: usize,
pub runtimes: Vec<RuntimeSummary>,
pub runtimes_not_listed: usize,
pub open_reviews: Vec<ReviewBrief>,
pub open_reviews_not_listed: usize,
pub untaken_handovers: Vec<HandoverBrief>,
pub untaken_handovers_not_listed: usize,
}Expand description
The mesh in an answer a worker reads whole: counts, each runtime, the open reviews and
the untaken handovers, every list bounded by SUMMARY_LIST with the rest counted.
use std::sync::Arc;
use majordomus_cli::mesh::identity::NodeIdentity;
use majordomus_cli::mesh::journal::{ClaimMode, EventBody, Journal, SessionInfo, StreamLiveness};
use majordomus_cli::mesh::state::fold;
let j = Journal::open(Arc::new(NodeIdentity::ephemeral().unwrap()), "0000000000000001",
"repo".into(), None).unwrap();
j.append_own(EventBody::SessionOpened { info: SessionInfo::named("s1", "claude-code") })
.unwrap();
for (claim, path) in [("c1", "apps/a"), ("c2", "apps/b")] {
j.append_own(EventBody::ClaimAcquired { claim: claim.into(), session: "s1".into(),
scope: vec![path.into()], intent: Some("work".into()), mode: ClaimMode::Exclusive,
issue: Some("#1".into()) }).unwrap();
}
j.append_own(EventBody::ClaimReleased { claim: "c1".into() }).unwrap();
let state = fold(&j.events(), &|_| StreamLiveness::Own);
use majordomus_cli::mesh::page::{summarize, Summary};
let summary: Summary = summarize(&state, &[]);
assert_eq!((summary.claims.held, summary.claims.released), (1, 1));
assert_eq!(summary.digest, state.digest);Fields§
§digest: StringThe whole fold’s digest: equal digests, equal state.
sessions: SessionCountsEvery session by standing.
claims: ClaimCountsEvery claim by standing.
overlaps: usizeAdvisory overlaps between live claims.
runtimes: Vec<RuntimeSummary>Each runtime counted, the living first; at most SUMMARY_LIST.
runtimes_not_listed: usizeRuntimes past the list, counted.
open_reviews: Vec<ReviewBrief>Review requests nobody has answered; at most SUMMARY_LIST.
open_reviews_not_listed: usizeOpen reviews past the list, counted.
untaken_handovers: Vec<HandoverBrief>Handovers nobody has consumed; at most SUMMARY_LIST.
untaken_handovers_not_listed: usizeUntaken handovers past the list, counted.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Summary
impl<'de> Deserialize<'de> for Summary
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 Summary
Source§impl JsonSchema for Summary
impl JsonSchema for Summary
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
Whether JSON Schemas generated for this type should be included directly in parent schemas,
rather than being re-used where possible using the
$ref keyword. Read moreimpl StructuralPartialEq for Summary
Auto Trait Implementations§
impl Freeze for Summary
impl RefUnwindSafe for Summary
impl Send for Summary
impl Sync for Summary
impl Unpin for Summary
impl UnsafeUnpin for Summary
impl UnwindSafe for Summary
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<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§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.