pub enum Head {
Branch {
name: Arc<str>,
commit: ObjectId,
},
Detached(ObjectId),
Unborn(Arc<str>),
}Expand description
HEAD’s three shapes, one to one with gix’s head::Kind.
Detached carries the commit and no name; Unborn carries the name and no
commit; a bare Cell<Arc<str>> could hold neither distinction. Branch
carries both, because an attached, born HEAD always has one: the environment
contract’s REPON_HEAD needs the resolved commit on this shape too, not only
on Detached.
Deferred: on the wire, gix::ObjectId’s own Serialize impl writes a commit as a raw
{"Sha1":[..20 numbers..]} array rather than a hex string, because gix does not offer a
hex encoding and adding one here would mean either a hand-written Serialize impl or
another crate on the allowlist for one field’s cosmetics. Functionally complete, not
pretty; nothing in this ticket’s acceptance criteria asks for a particular encoding.
Variants§
Branch
Attached to a branch, which points at a commit.
Detached(ObjectId)
Detached at a commit, with no branch name.
Unborn(Arc<str>)
A branch with no commit yet: ## No commits yet on <name>.
Trait Implementations§
impl Eq for Head
impl StructuralPartialEq for Head
Auto Trait Implementations§
impl Freeze for Head
impl RefUnwindSafe for Head
impl Send for Head
impl Sync for Head
impl Unpin for Head
impl UnsafeUnpin for Head
impl UnwindSafe for Head
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more