pub struct RefPrefixes { /* private fields */ }blocking-client or async-client only.Expand description
RefPrefixes are the set of prefixes that are sent to the server for
filtering purposes.
These are communicated by sending zero or more ref-prefix values, and
are documented in gitprotocol-v2.adoc#ls-refs.
These prefixes can be constructed from a set of RefSpec’s using
RefPrefixes::from_refspecs.
Alternatively, they can be constructed using RefPrefixes::new and
using RefPrefixes::extend to add new prefixes.
Implementations§
Source§impl RefPrefixes
impl RefPrefixes
Sourcepub fn new() -> RefPrefixes
pub fn new() -> RefPrefixes
Create an empty set of RefPrefixes.
Sourcepub fn from_refspecs<'a>(
refspecs: impl IntoIterator<Item = &'a RefSpec>,
) -> Self
pub fn from_refspecs<'a>( refspecs: impl IntoIterator<Item = &'a RefSpec>, ) -> Self
Convert a series of RefSpec’s into a set of RefPrefixes.
It attempts to expand each RefSpec into prefix references, e.g.
refs/heads/, refs/remotes/, refs/namespaces/foo/, etc.
Inputs that aren’t fully qualified refs, like HEAD or main, are
expanded in the same DWIM-style way that Git uses for ref-prefix
generation, yielding prefixes like HEAD, refs/heads/main, and
other rev-parse candidates.
Trait Implementations§
Source§impl Default for RefPrefixes
impl Default for RefPrefixes
Source§impl Extend<BString> for RefPrefixes
impl Extend<BString> for RefPrefixes
Source§fn extend<T: IntoIterator<Item = BString>>(&mut self, iter: T)
fn extend<T: IntoIterator<Item = BString>>(&mut self, iter: T)
Source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
extend_one)Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
extend_one)