pub struct OrdGraph {
pub ords: Vec<u32>,
pub tree: Vec<u32>,
pub parents: Vec<Vec<u32>>,
pub generation: Vec<u32>,
/* private fields */
}Expand description
The commit graph in integers: one row per commit, rows in the order the
CommitNode list came in (parents before children, as
crate::graph::assign_generations guarantees).
Fields§
§ords: Vec<u32>row → the commit’s ordinal.
tree: Vec<u32>row → the root tree’s ordinal, or NONE.
parents: Vec<Vec<u32>>row → parent rows (a parent outside the graph contributes nothing).
generation: Vec<u32>row → generation.
Implementations§
Source§impl OrdGraph
impl OrdGraph
Sourcepub fn from_nodes(nodes: &[CommitNode], space: &OrdinalSpace<'_>) -> Self
pub fn from_nodes(nodes: &[CommitNode], space: &OrdinalSpace<'_>) -> Self
Decode each node’s hex once and resolve it against the space. A node whose oid the space does not hold is kept as a row with no ordinal (it cannot be asked for by ordinal, and its children still see it as a parent row).
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
Sourcepub fn commits(&self) -> &RoaringBitmap
pub fn commits(&self) -> &RoaringBitmap
The set of commit ordinals.
pub fn is_commit(&self, ordinal: u32) -> bool
Trait Implementations§
Auto Trait Implementations§
impl Freeze for OrdGraph
impl RefUnwindSafe for OrdGraph
impl Send for OrdGraph
impl Sync for OrdGraph
impl Unpin for OrdGraph
impl UnsafeUnpin for OrdGraph
impl UnwindSafe for OrdGraph
Blanket Implementations§
impl<T> Allocation for T
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