docs/generated/contracts.mdgenerated from code
Reference · 2 min read
api-compatibility
Contracts: api-compatibility.
Read as
Source: crates/lvcs-api/src/lib.rs.
1/// The API's compatibility rules (discussion:owner/325), from v0.1.0 on. The2/// usual case is a newer client (the site's app, a paired device, a newer3/// CLI) against an older daemon, and the reverse happens too.4///5/// - Every type here (params, results, pushes, `ErrorData`) ignores6/// fields it doesn't know: none is `deny_unknown_fields`, which7/// `scripts/check.sh` refuses in this crate.8/// - A field added after v0.1.0 is an `Option` or `#[serde(default)]`, so9/// a reply or a request without it still decodes.10/// - Removing or renaming a field, changing its type or meaning, or11/// making an optional one required is a new op (or a new op version,12/// `<op>.v2`); the old one is served for at least one more minor13/// release.14/// - A result's or push's list, map, count, or flag, whose empty or zero15/// value reads as none, is `#[serde(default)]`; ids, addresses, heads,16/// frontiers, times, and closed-set values are required, and so is17/// every param an op can't do without (`invalid_params` names the op).18/// - A value added to a bounded set a result carries is refused by a19/// client older than the daemon; its next is `lvcs update`.20/// - A client ignores a push method it doesn't know.21/// - `hello`'s result (`host::HelloResult`) names the daemon's `version`22/// and this `API_VERSION`, which changes only with a change these rules23/// don't admit.24pub const API_VERSION: u16 = 1;