pub struct MatchGroup<'a> {
pub specs: Vec<RefSpecRef<'a>>,
}Expand description
A match group is able to match a list of ref specs in order while handling negation, conflicts and one to many mappings.
Fields§
§specs: Vec<RefSpecRef<'a>>The specs that take part in item matching.
Implementations§
Source§impl<'a> MatchGroup<'a>
Initialization
impl<'a> MatchGroup<'a>
Initialization
Sourcepub fn from_fetch_specs(specs: impl IntoIterator<Item = RefSpecRef<'a>>) -> Self
pub fn from_fetch_specs(specs: impl IntoIterator<Item = RefSpecRef<'a>>) -> Self
Take all the fetch ref specs from specs get a match group ready.
Sourcepub fn from_push_specs(specs: impl IntoIterator<Item = RefSpecRef<'a>>) -> Self
pub fn from_push_specs(specs: impl IntoIterator<Item = RefSpecRef<'a>>) -> Self
Take all the push ref specs from specs get a match group ready.
Source§impl<'spec> MatchGroup<'spec>
Matching
impl<'spec> MatchGroup<'spec>
Matching
Sourcepub fn match_lhs<'item>(
self,
items: impl Iterator<Item = Item<'item>> + Clone,
) -> Outcome<'spec, 'item>
pub fn match_lhs<'item>( self, items: impl Iterator<Item = Item<'item>> + Clone, ) -> Outcome<'spec, 'item>
Match all items against all fetch specs present in this group, returning deduplicated mappings from source to destination.
items are expected to be references on the remote, which will be matched and mapped to obtain their local counterparts,
i.e. left side of refspecs is mapped to their right side.
Note that this method is correct only for fetch-specs, even though it also works for push-specs.
Object names are never mapped and always returned as match.
Note that negative matches are not part of the return value, so they are not observable but will be used to remove mappings.
Sourcepub fn match_rhs<'item>(
self,
items: impl Iterator<Item = Item<'item>> + Clone,
) -> Outcome<'spec, 'item>
pub fn match_rhs<'item>( self, items: impl Iterator<Item = Item<'item>> + Clone, ) -> Outcome<'spec, 'item>
Match all items against the right-hand side of all fetch specs present in this group,
returning deduplicated mappings from destination to source.
items are expected to be tracking references in the local clone, which will be matched and reverse-mapped to obtain their remote counterparts,
i.e. right side of refspecs is mapped to their left side.
Even though this method starts by matching items against the right-hand side of positive refspecs,
negative fetch refspecs still exclude refs by their left-hand/source side. For that reason, once a
mapping has been reverse-mapped to its source ref, negative refspecs are applied to the mapping’s lhs.
Note that this method is correct only for fetch-specs, even though it also works for push-specs.
Note that negative matches are not part of the return value, so they are not observable but will be used to remove mappings.
Trait Implementations§
Source§impl<'a> Clone for MatchGroup<'a>
impl<'a> Clone for MatchGroup<'a>
Source§fn clone(&self) -> MatchGroup<'a>
fn clone(&self) -> MatchGroup<'a>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more