pub struct RefPattern { /* private fields */ }Expand description
One ref pattern, with no !.
A pattern is split at /. Each part is a literal that passes
is_ref_name_component, *, or **. * matches exactly one part of a
name, and ** matches one or more parts. * and ** are valid only as a
whole part. The matcher costs at most the number of pattern parts times
the number of name parts, so a caller that takes patterns from the
network must cap the number and the length of the patterns. It does not
check that a name is a valid ref name.
Implementations§
Source§impl RefPattern
impl RefPattern
Sourcepub fn parse(pattern: &str) -> Result<RefPattern>
pub fn parse(pattern: &str) -> Result<RefPattern>
Parses one pattern.
§Errors
Error::InvalidRefPatternif the pattern is empty, has an empty part, holds!, has a part with*that is not*or**, or has a literal part that failsis_ref_name_component. The text names the pattern.
Trait Implementations§
Source§impl Clone for RefPattern
impl Clone for RefPattern
Source§impl Debug for RefPattern
impl Debug for RefPattern
impl Eq for RefPattern
Source§impl PartialEq for RefPattern
impl PartialEq for RefPattern
impl StructuralPartialEq for RefPattern
Auto Trait Implementations§
impl Forget for RefPattern
impl Freeze for RefPattern
impl Move for RefPattern
impl RefUnwindSafe for RefPattern
impl Send for RefPatternwhere
RawVecInner: Send,
impl Sync for RefPatternwhere
RawVecInner: Sync,
impl Unpin for RefPattern
impl UnsafeUnpin for RefPatternwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<Part>: UnsafeUnpin,
impl UnwindSafe for RefPatternwhere
RawVecInner: UnwindSafe,
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