pub struct Location<Name> {
pub descendant: Name,
pub distance: u64,
}Expand description
The position of one node in the graph relative their known descendant.
This structure is relevant when the IdMap is lazy. Assuming that all parents of merges
and all heads are known then any node can be represented as their first descendant
and the distance to that descendant.
Example:
0 - a - b - c
In this example our initial commit is 0, then we have a the first commit, b second,
c third.
{
descendant: c,
distance: 1,
}
=> [b]
Fields§
§descendant: Name§distance: u64Implementations§
Source§impl<Name> Location<Name>
impl<Name> Location<Name>
pub fn new(descendant: Name, distance: u64) -> Location<Name>
pub fn map_descendant<T, F>(self, f: F) -> Location<T>where
F: FnOnce(Name) -> T,
pub fn try_map_descendant<T, E, F>(self, f: F) -> Result<Location<T>, E>
pub async fn then_descendant<T, Fut, F>(self, f: F) -> Location<T>
pub async fn and_then_descendant<T, E, Fut, F>( self, f: F, ) -> Result<Location<T>, E>
pub fn with_descendant<T>(self, descendant: T) -> Location<T>
Trait Implementations§
Source§impl<'de, Name> Deserialize<'de> for Location<Name>where
Name: Deserialize<'de>,
impl<'de, Name> Deserialize<'de> for Location<Name>where
Name: Deserialize<'de>,
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Location<Name>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Location<Name>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<Name> Ord for Location<Name>where
Name: Ord,
impl<Name> Ord for Location<Name>where
Name: Ord,
1.21.0 · 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<Name> PartialOrd for Location<Name>where
Name: PartialOrd,
impl<Name> PartialOrd for Location<Name>where
Name: PartialOrd,
Source§impl<Name> Serialize for Location<Name>where
Name: Serialize,
impl<Name> Serialize for Location<Name>where
Name: Serialize,
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl<Name> Copy for Location<Name>where
Name: Copy,
impl<Name> Eq for Location<Name>where
Name: Eq,
impl<Name> StructuralPartialEq for Location<Name>
Auto Trait Implementations§
impl<Name> Freeze for Location<Name>where
Name: Freeze,
impl<Name> RefUnwindSafe for Location<Name>where
Name: RefUnwindSafe,
impl<Name> Send for Location<Name>where
Name: Send,
impl<Name> Sync for Location<Name>where
Name: Sync,
impl<Name> Unpin for Location<Name>where
Name: Unpin,
impl<Name> UnwindSafe for Location<Name>where
Name: 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