pub enum Disposition {
Integrated,
Published,
LocalOnly,
Uncommitted,
}Expand description
Where the work a holding carries can be reached from.
The order is the order of safety: everything above Disposition::LocalOnly is
reachable by somebody who is not the worker that made it.
use majordomus_cli::convergence::Disposition;
// declared in the order of safety, so the derived order says which is worse
assert!(Disposition::Integrated < Disposition::Published);
assert!(Disposition::Published < Disposition::LocalOnly);
assert_eq!(serde_json::to_string(&Disposition::LocalOnly).unwrap(), "\"local_only\"");Variants§
Integrated
The trunk reaches it: it is in the repository’s own history.
Published
A remote reaches it: another checkout can fetch it, and it survives this disk.
LocalOnly
Committed here and nowhere else. One disk away from being lost.
Uncommitted
Not committed at all: files in a work tree, or a stash entry.
Implementations§
Source§impl Disposition
impl Disposition
Sourcepub fn as_str(&self) -> &'static str
pub fn as_str(&self) -> &'static str
The word this disposition is reported under — the same word its serialisation carries, so a tally keyed by it and a holding carrying it agree.
use majordomus_cli::convergence::Disposition;
assert_eq!(Disposition::LocalOnly.as_str(), "local_only");
let json = serde_json::to_string(&Disposition::Uncommitted).unwrap();
assert_eq!(json, format!("\"{}\"", Disposition::Uncommitted.as_str()));Sourcepub fn at_risk(&self) -> bool
pub fn at_risk(&self) -> bool
This holding’s work exists on one disk only: the verdict refuses over exactly these.
use majordomus_cli::convergence::Disposition;
let risky: Vec<_> = [
Disposition::Integrated,
Disposition::Published,
Disposition::LocalOnly,
Disposition::Uncommitted,
]
.into_iter()
.filter(Disposition::at_risk)
.collect();
assert_eq!(risky, [Disposition::LocalOnly, Disposition::Uncommitted]);Trait Implementations§
Source§impl Clone for Disposition
impl Clone for Disposition
Source§fn clone(&self) -> Disposition
fn clone(&self) -> Disposition
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for Disposition
Source§impl Debug for Disposition
impl Debug for Disposition
Source§impl<'de> Deserialize<'de> for Disposition
impl<'de> Deserialize<'de> for Disposition
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 Disposition
Source§impl JsonSchema for Disposition
impl JsonSchema for Disposition
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 Ord for Disposition
impl Ord for Disposition
Source§fn cmp(&self, other: &Disposition) -> Ordering
fn cmp(&self, other: &Disposition) -> Ordering
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
Source§impl PartialEq for Disposition
impl PartialEq for Disposition
Source§fn eq(&self, other: &Disposition) -> bool
fn eq(&self, other: &Disposition) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl PartialOrd for Disposition
impl PartialOrd for Disposition
Source§impl Serialize for Disposition
impl Serialize for Disposition
impl StructuralPartialEq for Disposition
Auto Trait Implementations§
impl Freeze for Disposition
impl RefUnwindSafe for Disposition
impl Send for Disposition
impl Sync for Disposition
impl Unpin for Disposition
impl UnsafeUnpin for Disposition
impl UnwindSafe for Disposition
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<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
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.