docs/generated/contracts.mdgenerated from code
Reference · 2 min read
api-project
Contracts: api-project.
Read as
Source: crates/lvcs-api/src/project.rs.
1/// `project.summary` (discussion:owner/303). On a project's connection, that2/// project's [`Summary`]. On the host's connection, a3/// [`ProjectSummaryResult`]: one entry per hosted project, each read as4/// its default peer.5#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]6pub struct ProjectSummaryParams {}78/// `project.summary` result on the host's connection, by root.9#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]10pub struct ProjectSummaryResult {11 #[serde(default)]12 pub projects: Vec<ProjectSummary>,13}1415/// One hosted project's summary on the host's connection. `summary` is16/// absent, and the counts zero, while the project isn't open, or when it17/// didn't answer within `HOST_GATHER_MS`.18#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]19pub struct ProjectSummary {20 /// Its canonical root.21 pub root: String,22 /// Its lifecycle stage, as `HostedProject.stage`.23 pub stage: String,24 #[serde(default, skip_serializing_if = "Option::is_none")]25 pub summary: Option<Summary>,26 /// The peers present now (`presence.list`), by name, sorted.27 #[serde(default)]28 pub present: Vec<String>,29 /// The peer's unread notifications.30 #[serde(default)]31 pub unread: u32,32}3334/// `project.summary` result on a project's connection.35#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]36pub struct Summary {37 /// Its project id, in `ID_ENCODING`.38 pub project: String,39 /// The owner, by name (`Named`).40 pub owner: String,41 /// The connection's peer, by name.42 pub peer: String,43 /// The connected nodes.44 #[serde(default)]45 pub nodes: u32,46 /// Each channel and combination, by name, with its value's frontier47 /// count.48 #[serde(default)]49 pub channels: Vec<SummaryChannel>,50 /// The `activity` pushes of the last `ACTIVITY_RECENT_SECS`.51 #[serde(default)]52 pub activity: u32,53 /// The protected paths waiting for approval (discussion:owner/314).54 #[serde(default, skip_serializing_if = "Vec::is_empty")]55 pub waiting: Vec<String>,56}5758/// A channel's name and how many frontiers its value holds.59#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]60pub struct SummaryChannel {61 pub name: String,62 pub frontiers: u32,63}6465/// `inbox` (discussion:owner/303): every hosted project's notifications for its66/// default peer, metadata only, as `notifications` lists them;67/// nothing is marked read.68#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]69pub struct InboxParams {}7071/// `inbox` result, by root.72#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]73pub struct InboxResult {74 #[serde(default)]75 pub projects: Vec<InboxProject>,76}7778/// One hosted project's notifications: the default peer's79/// `notifications` listing, absent while the project isn't open, or when80/// it didn't answer within `HOST_GATHER_MS`.81#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]82pub struct InboxProject {83 pub root: String,84 /// Its lifecycle stage, as `HostedProject.stage`.85 pub stage: String,86 #[serde(default, skip_serializing_if = "Option::is_none")]87 pub notifications: Option<NotificationsResult>,88}