gix_traverse::commit::topo

Struct Builder

Source
pub struct Builder<Find, Predicate> { /* private fields */ }
Expand description

Builder for Topo.

Implementations§

Source§

impl<Find> Builder<Find, fn(_: &oid) -> bool>
where Find: Find,

Source

pub fn from_iters( find: Find, tips: impl IntoIterator<Item = impl Into<ObjectId>>, ends: Option<impl IntoIterator<Item = impl Into<ObjectId>>>, ) -> Self

Create a new Builder for a Topo that reads commits from a repository with find. starting at the tips and ending at the ends. Like git rev-list --topo-order ^ends tips.

Source

pub fn with_predicate<Predicate>( self, predicate: Predicate, ) -> Builder<Find, Predicate>
where Predicate: FnMut(&oid) -> bool,

Set a predicate to filter out revisions from the walk. Can be used to implement e.g. filtering on paths or time. This does not exclude the parent(s) of a revision that is excluded. Specify a revision as an ‘end’ if you want that behavior.

Source§

impl<Find, Predicate> Builder<Find, Predicate>
where Find: Find, Predicate: FnMut(&oid) -> bool,

Source

pub fn sorting(self, sorting: Sorting) -> Self

Set the sorting to use for the topological walk.

Source

pub fn parents(self, parents: Parents) -> Self

Specify how to handle commit parents during traversal.

Source

pub fn with_commit_graph(self, commit_graph: Option<Graph>) -> Self

Set or unset the commit_graph to use for the iteration.

Source

pub fn build(self) -> Result<Topo<Find, Predicate>, Error>

Build a new Topo instance.

Note that merely building an instance is currently expensive.

Auto Trait Implementations§

§

impl<Find, Predicate> Freeze for Builder<Find, Predicate>
where Find: Freeze, Predicate: Freeze,

§

impl<Find, Predicate> RefUnwindSafe for Builder<Find, Predicate>
where Find: RefUnwindSafe, Predicate: RefUnwindSafe,

§

impl<Find, Predicate> Send for Builder<Find, Predicate>
where Find: Send, Predicate: Send,

§

impl<Find, Predicate> Sync for Builder<Find, Predicate>
where Find: Sync, Predicate: Sync,

§

impl<Find, Predicate> Unpin for Builder<Find, Predicate>
where Find: Unpin, Predicate: Unpin,

§

impl<Find, Predicate> UnwindSafe for Builder<Find, Predicate>
where Find: UnwindSafe, Predicate: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.