[][src]Struct radicle_surf::vcs::History

pub struct History<A>(pub NonEmpty<A>);

A non-empty bag of artifacts which are used to derive a Directory view. Examples of artifacts would be commits in Git or patches in Pijul.

Methods

impl<A> History<A>[src]

pub fn new(a: A) -> Self[src]

pub fn push(&mut self, a: A)[src]

pub fn iter<'a>(&'a self) -> impl Iterator<Item = &A> + 'a[src]

Iterator over the artifacts.

pub fn first(&self) -> &A[src]

pub fn find_suffix(&self, artifact: &A) -> Option<Self> where
    A: Clone + PartialEq
[src]

Given that the History is topological order from most recent artifact to least recent, find_suffix gets returns the history up until the point of the given artifact.

This operation may fail if the artifact does not exist in the given History.

pub fn map<F, B>(&self, f: F) -> History<B> where
    F: Fn(&A) -> B, 
[src]

pub fn find<F, B>(&self, f: F) -> Option<B> where
    F: Fn(&A) -> Option<B>, 
[src]

pub fn find_in_history<Identifier, F>(
    &self,
    identifier: &Identifier,
    id_of: F
) -> Option<A> where
    A: Clone,
    F: Fn(&A) -> Identifier,
    Identifier: PartialEq
[src]

Find an atrifact in the given History using the artifacts ID.

This operation may fail if the artifact does not exist in the history.

pub fn find_in_histories<Identifier, F>(
    histories: Vec<Self>,
    identifier: &Identifier,
    id_of: F
) -> Vec<Self> where
    A: Clone,
    F: Fn(&A) -> Identifier + Copy,
    Identifier: PartialEq
[src]

Find all occurences of an artifact in a bag of Historys.

Trait Implementations

impl<A: Clone> Clone for History<A>[src]

impl<A: Debug> Debug for History<A>[src]

impl<A: Eq> Eq for History<A>[src]

impl<A: Ord> Ord for History<A>[src]

impl<A: PartialEq> PartialEq<History<A>> for History<A>[src]

impl<A: PartialOrd> PartialOrd<History<A>> for History<A>[src]

impl<A> StructuralEq for History<A>[src]

impl<A> StructuralPartialEq for History<A>[src]

Auto Trait Implementations

impl<A> RefUnwindSafe for History<A> where
    A: RefUnwindSafe

impl<A> Send for History<A> where
    A: Send

impl<A> Sync for History<A> where
    A: Sync

impl<A> Unpin for History<A> where
    A: Unpin

impl<A> UnwindSafe for History<A> where
    A: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.