pub struct WalkOptions {
pub starting_points: Vec<VoidCid>,
pub max_commits: Option<usize>,
pub order: WalkOrder,
}Expand description
Options for commit traversal.
Fields§
§starting_points: Vec<VoidCid>Starting commit CIDs for the walk.
max_commits: Option<usize>Maximum number of commits to visit (None = unlimited).
order: WalkOrderWalk order (default: HeadToRoot).
Implementations§
Source§impl WalkOptions
impl WalkOptions
Sourcepub fn from_all_refs(void_dir: &Utf8Path) -> Result<Self>
pub fn from_all_refs(void_dir: &Utf8Path) -> Result<Self>
Create walk options starting from HEAD and all branch heads.
This is useful for operations that need complete coverage of all commits in the repository, including those on feature branches.
Sourcepub fn from_commit(commit_cid: VoidCid) -> Self
pub fn from_commit(commit_cid: VoidCid) -> Self
Create walk options starting from a specific commit.
Sourcepub fn from_commits(commit_cids: Vec<VoidCid>) -> Self
pub fn from_commits(commit_cids: Vec<VoidCid>) -> Self
Create walk options starting from multiple commits.
Sourcepub fn with_max_commits(self, max: usize) -> Self
pub fn with_max_commits(self, max: usize) -> Self
Set maximum number of commits to visit.
Sourcepub fn with_order(self, order: WalkOrder) -> Self
pub fn with_order(self, order: WalkOrder) -> Self
Set the walk order.
Default is HeadToRoot (BFS from newest to oldest).
Use RootToHead for topological traversal from oldest to newest.
Trait Implementations§
Source§impl Clone for WalkOptions
impl Clone for WalkOptions
Source§fn clone(&self) -> WalkOptions
fn clone(&self) -> WalkOptions
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for WalkOptions
impl RefUnwindSafe for WalkOptions
impl Send for WalkOptions
impl Sync for WalkOptions
impl Unpin for WalkOptions
impl UnsafeUnpin for WalkOptions
impl UnwindSafe for WalkOptions
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<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