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) -> Self
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<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
Source§impl<Name: Ord> Ord for Location<Name>
impl<Name: Ord> Ord for Location<Name>
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> PartialOrd for Location<Name>
impl<Name: PartialOrd> PartialOrd for Location<Name>
impl<Name: Copy> Copy for Location<Name>
impl<Name: Eq> Eq for Location<Name>
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> UnsafeUnpin for Location<Name>where
Name: UnsafeUnpin,
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