Struct branchless::core::graph::Node[][src]

pub struct Node<'repo> {
    pub commit: Commit<'repo>,
    pub parent: Option<NonZeroOid>,
    pub children: Vec<NonZeroOid>,
    pub is_main: bool,
    pub is_visible: bool,
    pub event: Option<Event>,
}
Expand description

Node contained in the smartlog commit graph.

Fields

commit: Commit<'repo>

The underlying commit object.

parent: Option<NonZeroOid>

The OID of the parent node in the smartlog commit graph.

This is different from inspecting commit.parents(), since the smartlog will hide most nodes from the commit graph, including parent nodes.

children: Vec<NonZeroOid>

The OIDs of the children nodes in the smartlog commit graph.

is_main: bool

Indicates that this is a commit to the main branch.

These commits are considered to be immutable and should never leave the main state. However, this can still happen sometimes if the user’s workflow is different than expected.

is_visible: bool

Indicates that this commit should be considered “visible”.

A visible commit is a commit that hasn’t been checked into the main branch, but the user is actively working on. We may infer this from user behavior, e.g. they committed something recently, so they are now working on it.

In contrast, a hidden commit is a commit that hasn’t been checked into the main branch, and the user is no longer working on. We may infer this from user behavior, e.g. they have rebased a commit and no longer want to see the old version of that commit. The user can also manually hide commits.

Occasionally, a main commit can be marked as hidden, such as if a commit in the main branch has been rewritten. We don’t expect this to happen in the monorepo workflow, but it can happen in other workflows where you commit directly to the main branch and then later rewrite the commit.

event: Option<Event>

The latest event to affect this commit.

It’s possible that no event affected this commit, and it was simply visible due to a reference pointing to it. In that case, this field is None.

Trait Implementations

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

Set the foreground color generically Read more

Set the background color generically. Read more

Change the foreground color to black

Change the foreground color to black

Change the foreground color to red

Change the foreground color to red

Change the foreground color to green

Change the foreground color to green

Change the foreground color to yellow

Change the foreground color to yellow

Change the foreground color to blue

Change the foreground color to blue

Change the foreground color to magenta

Change the foreground color to magenta

Change the foreground color to purple

Change the foreground color to purple

Change the foreground color to cyan

Change the foreground color to cyan

Change the foreground color to white

Change the foreground color to white

Change the foreground color to bright black

Change the foreground color to bright black

Change the foreground color to bright red

Change the foreground color to bright red

Change the foreground color to bright green

Change the foreground color to bright green

Change the foreground color to bright yellow

Change the foreground color to bright yellow

Change the foreground color to bright blue

Change the foreground color to bright blue

Change the foreground color to bright magenta

Change the foreground color to bright magenta

Change the foreground color to bright purple

Change the foreground color to bright purple

Change the foreground color to bright cyan

Change the foreground color to bright cyan

Change the foreground color to bright white

Change the foreground color to bright white

Make the text bold

Make the text dim

Make the text italicized

Make the text italicized

Make the text blink

Make the text blink (but fast!)

Swap the foreground and background colors

Hide the text

Cross out the text

Set the foreground color at runtime. Only use if you do not know which color will be used at compile-time. If the color is constant, use either OwoColorize::fg or a color-specific method, such as OwoColorize::green, Read more

Set the background color at runtime. Only use if you do not know what color to use at compile-time. If the color is constant, use either OwoColorize::bg or a color-specific method, such as OwoColorize::on_yellow, Read more

Sets the foreground color to an RGB value.

Sets the background color to an RGB value.

Apply a runtime-determined style

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Calls the given closure and return the result. Read more

Calls the given closure on self.

Calls the given closure on self.

Calls the given closure if condition == true.