pub enum Containment {
Contains,
DoesNotContain,
CommitUnknown,
}Expand description
Whether one commit contains another: three answers, because “no” and “this clone cannot say” send a reader to different places.
Evidence recorded on a commit the presented revision does not contain is evidence about some other history, however empty a diff between the two happens to be. And a commit this clone does not have — a rewritten branch, a shallow fetch, a typo — is neither a yes nor a no, so it is not collapsed into either.
This is the one definition. PR #600 carries a private copy in delivery::revision, with
the same variants and meaning; it imports this one and deletes its copy.
use majordomus_cli::git::Containment;
// only one of the three answers is a yes
let answers = [
Containment::Contains,
Containment::DoesNotContain,
Containment::CommitUnknown,
];
assert_eq!(answers.iter().filter(|a| **a == Containment::Contains).count(), 1);
assert_ne!(Containment::DoesNotContain, Containment::CommitUnknown);Variants§
Contains
The ancestor is reachable from the descendant.
DoesNotContain
Both commits are known here, and the ancestor is not reachable from the descendant.
CommitUnknown
This clone does not have one of the two commits, or git could not be asked, so the question has no answer here.
Trait Implementations§
Source§impl Clone for Containment
impl Clone for Containment
Source§fn clone(&self) -> Containment
fn clone(&self) -> Containment
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for Containment
Source§impl Debug for Containment
impl Debug for Containment
impl Eq for Containment
Source§impl PartialEq for Containment
impl PartialEq for Containment
Source§fn eq(&self, other: &Containment) -> bool
fn eq(&self, other: &Containment) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for Containment
Auto Trait Implementations§
impl Freeze for Containment
impl RefUnwindSafe for Containment
impl Send for Containment
impl Sync for Containment
impl Unpin for Containment
impl UnsafeUnpin for Containment
impl UnwindSafe for Containment
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
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> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.