pub enum Lookup<Value> {
Unset,
Found(Value),
Unhandled,
}Expand description
What: The answer of one lookup. Why: “Not set” and “set to this” are Git’s answers; “unhandled” is this module declining to guess, so the caller falls back to starting Git, which is never a failure.
In TS you’d write (pseudocode):
type Lookup<T> = { kind: 'unset' } | { kind: 'found'; value: T } | { kind: 'unhandled' };Variants§
Unset
No entry has the key, so git config --get exits 1.
Found(Value)
The last entry of the key, converted exactly as Git converts it.
Unhandled
Some entry of the key has a shape this module does not reproduce; ask Git.
Trait Implementations§
impl<Value: Eq> Eq for Lookup<Value>
impl<Value: PartialEq> StructuralPartialEq for Lookup<Value>
Auto Trait Implementations§
impl<Value> Freeze for Lookup<Value>where
Value: Freeze,
impl<Value> RefUnwindSafe for Lookup<Value>where
Value: RefUnwindSafe,
impl<Value> Send for Lookup<Value>where
Value: Send,
impl<Value> Sync for Lookup<Value>where
Value: Sync,
impl<Value> Unpin for Lookup<Value>where
Value: Unpin,
impl<Value> UnsafeUnpin for Lookup<Value>where
Value: UnsafeUnpin,
impl<Value> UnwindSafe for Lookup<Value>where
Value: UnwindSafe,
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
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§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
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> ⓘ
Converts
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> ⓘ
Converts
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