Struct radicle_surf::Glob

source ·
pub struct Glob<T> { /* private fields */ }
Expand description

A collection of globs for a git reference type.

Implementations§

source§

impl<T> Glob<T>

source

pub fn globs(&self) -> impl Iterator<Item = &QualifiedPattern<'static>>

Return the QualifiedPattern globs of this Glob.

source

pub fn and(self, other: impl Into<Self>) -> Self

Combine two Globs together by combining their glob lists together.

Note that the Globs must result in the same type, e.g. Glob<Tag> can only combine with Glob<Tag>, Glob<Local> can combine with Glob<Remote>, etc.

source§

impl Glob<Namespace>

source

pub fn all_namespaces() -> Self

Creates the Glob that matches all refs/namespaces.

source

pub fn namespaces(glob: PatternString) -> Self

Creates a Glob for refs/namespaces, starting with glob.

source

pub fn insert(self, glob: PatternString) -> Self

Adds a refs/namespaces pattern to this Glob.

source§

impl Glob<Tag>

source

pub fn all_tags() -> Self

Creates a Glob that matches all refs/tags.

source

pub fn tags(glob: PatternString) -> Self

Creates a Glob for refs/tags, starting with glob.

source

pub fn insert(self, glob: PatternString) -> Self

Adds a refs/tags pattern to this Glob.

source§

impl Glob<Local>

source

pub fn all_heads() -> Self

Creates the Glob that matches all refs/heads.

source

pub fn heads(glob: PatternString) -> Self

Creates a Glob for refs/heads, starting with glob.

source

pub fn insert(self, glob: PatternString) -> Self

Adds a refs/heads pattern to this Glob.

source

pub fn branches(self) -> Glob<Branch>

When chaining Glob<Local> with Glob<Remote>, use branches to convert this Glob<Local> into a Glob<Branch>.

§Example
Glob::heads(pattern!("features/*"))
    .insert(pattern!("qa/*"))
    .branches()
    .and(Glob::remotes(pattern!("origin/features/*")))
source§

impl Glob<Remote>

source

pub fn all_remotes() -> Self

Creates the Glob that matches all refs/remotes.

source

pub fn remotes(glob: PatternString) -> Self

Creates a Glob for refs/remotes, starting with glob.

source

pub fn insert(self, glob: PatternString) -> Self

Adds a refs/remotes pattern to this Glob.

source

pub fn branches(self) -> Glob<Branch>

When chaining Glob<Remote> with Glob<Local>, use branches to convert this Glob<Remote> into a Glob<Branch>.

§Example
Glob::remotes(pattern!("origin/features/*"))
    .insert(pattern!("origin/qa/*"))
    .branches()
    .and(Glob::heads(pattern!("features/*")))
source§

impl Glob<Qualified<'_>>

source

pub fn all_category<R: AsRef<RefStr>>(category: R) -> Self

source

pub fn categories<R>(category: R, glob: PatternString) -> Self
where R: AsRef<RefStr>,

Creates a Glob for refs/<category>, starting with glob.

source

pub fn insert<R>(self, category: R, glob: PatternString) -> Self
where R: AsRef<RefStr>,

Adds a refs/<category> pattern to this Glob.

Trait Implementations§

source§

impl<T: Clone> Clone for Glob<T>

source§

fn clone(&self) -> Glob<T>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<T: Debug> Debug for Glob<T>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<T> Default for Glob<T>

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Extend<PatternString> for Glob<Local>

source§

fn extend<T: IntoIterator<Item = PatternString>>(&mut self, iter: T)

Extends a collection with the contents of an iterator. Read more
source§

fn extend_one(&mut self, item: A)

🔬This is a nightly-only experimental API. (extend_one)
Extends a collection with exactly one element.
source§

fn extend_reserve(&mut self, additional: usize)

🔬This is a nightly-only experimental API. (extend_one)
Reserves capacity in a collection for the given number of additional elements. Read more
source§

impl Extend<PatternString> for Glob<Namespace>

source§

fn extend<T: IntoIterator<Item = PatternString>>(&mut self, iter: T)

Extends a collection with the contents of an iterator. Read more
source§

fn extend_one(&mut self, item: A)

🔬This is a nightly-only experimental API. (extend_one)
Extends a collection with exactly one element.
source§

fn extend_reserve(&mut self, additional: usize)

🔬This is a nightly-only experimental API. (extend_one)
Reserves capacity in a collection for the given number of additional elements. Read more
source§

impl Extend<PatternString> for Glob<Remote>

source§

fn extend<T: IntoIterator<Item = PatternString>>(&mut self, iter: T)

Extends a collection with the contents of an iterator. Read more
source§

fn extend_one(&mut self, item: A)

🔬This is a nightly-only experimental API. (extend_one)
Extends a collection with exactly one element.
source§

fn extend_reserve(&mut self, additional: usize)

🔬This is a nightly-only experimental API. (extend_one)
Reserves capacity in a collection for the given number of additional elements. Read more
source§

impl Extend<PatternString> for Glob<Tag>

source§

fn extend<T: IntoIterator<Item = PatternString>>(&mut self, iter: T)

Extends a collection with the contents of an iterator. Read more
source§

fn extend_one(&mut self, item: A)

🔬This is a nightly-only experimental API. (extend_one)
Extends a collection with exactly one element.
source§

fn extend_reserve(&mut self, additional: usize)

🔬This is a nightly-only experimental API. (extend_one)
Reserves capacity in a collection for the given number of additional elements. Read more
source§

impl From<Glob<Local>> for Glob<Branch>

source§

fn from(_: Glob<Local>) -> Self

Converts to this type from the input type.
source§

impl From<Glob<Remote>> for Glob<Branch>

source§

fn from(_: Glob<Remote>) -> Self

Converts to this type from the input type.
source§

impl FromIterator<PatternString> for Glob<Local>

source§

fn from_iter<T: IntoIterator<Item = PatternString>>(iter: T) -> Self

Creates a value from an iterator. Read more
source§

impl FromIterator<PatternString> for Glob<Namespace>

source§

fn from_iter<T: IntoIterator<Item = PatternString>>(iter: T) -> Self

Creates a value from an iterator. Read more
source§

impl FromIterator<PatternString> for Glob<Remote>

source§

fn from_iter<T: IntoIterator<Item = PatternString>>(iter: T) -> Self

Creates a value from an iterator. Read more
source§

impl FromIterator<PatternString> for Glob<Tag>

source§

fn from_iter<T: IntoIterator<Item = PatternString>>(iter: T) -> Self

Creates a value from an iterator. Read more

Auto Trait Implementations§

§

impl<T> Freeze for Glob<T>

§

impl<T> RefUnwindSafe for Glob<T>
where T: RefUnwindSafe,

§

impl<T> Send for Glob<T>
where T: Send,

§

impl<T> Sync for Glob<T>
where T: Sync,

§

impl<T> Unpin for Glob<T>
where T: Unpin,

§

impl<T> UnwindSafe for Glob<T>
where T: 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> CloneToUninit for T
where T: Clone,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. 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> ToOwned for T
where T: Clone,

source§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.