pub struct RawRules {
pub rules: BTreeMap<Pattern, Rule<Allowed, usize>>,
}Expand description
A set of RawRules that can be serialized and deserialized.
Fields§
§rules: BTreeMap<Pattern, Rule<Allowed, usize>>The reference pattern that this rule applies to.
Note that this can be a fully-qualified pattern, e.g. refs/heads/qa,
as well as a wild-card pattern, e.g. refs/tags/*.
Implementations§
Source§impl RawRules
impl RawRules
Sourcepub fn insert(
&mut self,
pattern: Pattern,
rule: Rule<Allowed, usize>,
) -> Option<Rule<Allowed, usize>>
pub fn insert( &mut self, pattern: Pattern, rule: Rule<Allowed, usize>, ) -> Option<Rule<Allowed, usize>>
Add a new RawRule to the set of rules.
Returns the replaced rule, if it existed.
Sourcepub fn remove(&mut self, pattern: &Pattern) -> Option<Rule<Allowed, usize>>
pub fn remove(&mut self, pattern: &Pattern) -> Option<Rule<Allowed, usize>>
Remove the rule that matches the pattern parameter.
Returns the rule if it existed.
Sourcepub fn exact_match(&self, refname: &Qualified<'_>) -> bool
pub fn exact_match(&self, refname: &Qualified<'_>) -> bool
Check to see if there is an exact match for refname in the rules.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for RawRules
impl<'de> Deserialize<'de> for RawRules
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<RawRules, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<RawRules, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Extend<(Pattern, Rule<Allowed, usize>)> for RawRules
impl Extend<(Pattern, Rule<Allowed, usize>)> for RawRules
Source§fn extend<T>(&mut self, iter: T)
fn extend<T>(&mut self, iter: T)
Extends a collection with the contents of an iterator. Read more
Source§fn extend_one(&mut self, item: A)
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)
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 IntoIterator for RawRules
impl IntoIterator for RawRules
Source§impl Serialize for RawRules
impl Serialize for RawRules
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl Eq for RawRules
impl StructuralPartialEq for RawRules
Auto Trait Implementations§
impl Freeze for RawRules
impl RefUnwindSafe for RawRules
impl Send for RawRules
impl Sync for RawRules
impl Unpin for RawRules
impl UnwindSafe for RawRules
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more