pub struct Holding {
pub kind: HoldingKind,
pub identity: String,
pub disposition: Disposition,
pub evidence: String,
pub remedy: String,
pub at_risk: bool,
}Expand description
One thing holding work, and what is known about where that work can be reached from.
use majordomus_cli::convergence::{Disposition, Holding, HoldingKind};
let branch = Holding {
kind: HoldingKind::Branch,
identity: "feature/x".into(),
disposition: Disposition::LocalOnly,
evidence: "abc123 is on no remote-tracking ref of this checkout".into(),
remedy: "git push -u origin feature/x".into(),
at_risk: true,
};
// an at-risk holding always carries the command that would move it out of danger
assert!(branch.at_risk && !branch.remedy.is_empty());
// and a reachable one carries none, so the field is left out of the document
let safe = Holding { disposition: Disposition::Published, remedy: String::new(), at_risk: false, ..branch };
assert!(!serde_json::to_string(&safe).unwrap().contains("remedy"));Fields§
§kind: HoldingKindWhat kind of thing holds it.
identity: StringHow it is named: a branch name, an absolute worktree path, a stash ref.
disposition: DispositionWhere the work can be reached from.
evidence: StringWhat was actually read — never a restatement of the disposition.
remedy: StringThe command that would move it out of danger. Empty when it is not at risk.
at_risk: boolThis holding’s work exists on one disk only.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Holding
impl<'de> Deserialize<'de> for Holding
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 Holding
Source§impl JsonSchema for Holding
impl JsonSchema for Holding
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 moreSource§impl Ordered for Holding
One collection, one order, declared once: at-risk holdings first (the group), then by
kind in the order a worker meets them (a work tree, its branch, a stash), then by
identity. Every surface that lists holdings shows this order, because none of them sorts.
impl Ordered for Holding
One collection, one order, declared once: at-risk holdings first (the group), then by kind in the order a worker meets them (a work tree, its branch, a stash), then by identity. Every surface that lists holdings shows this order, because none of them sorts.
impl StructuralPartialEq for Holding
Auto Trait Implementations§
impl Freeze for Holding
impl RefUnwindSafe for Holding
impl Send for Holding
impl Sync for Holding
impl Unpin for Holding
impl UnsafeUnpin for Holding
impl UnwindSafe for Holding
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.