pub struct Branch(/* private fields */);Expand description
A validated git branch name.
Branch names follow git’s reference naming rules:
- Cannot be empty
- Cannot start with
-,., or/ - Cannot end with
/,., or.lock - Cannot contain
..,//,@{, or control characters - Cannot contain spaces or forbidden characters:
~^:?*[\ - Cannot be single
@ - No component can start with
.or end with.lock
Implementations§
Source§impl Branch
impl Branch
Sourcepub fn has_parents(&self) -> bool
pub fn has_parents(&self) -> bool
Returns true if the branch name contains path separators.
Sourcepub const fn from_static_or_panic(input: &'static str) -> Self
pub const fn from_static_or_panic(input: &'static str) -> Self
Creates a branch name from a static string, panicking if invalid.
This is useful for compile-time constants.
Trait Implementations§
impl Eq for Branch
impl StructuralPartialEq for Branch
Auto Trait Implementations§
impl Freeze for Branch
impl RefUnwindSafe for Branch
impl Send for Branch
impl Sync for Branch
impl Unpin for Branch
impl UnwindSafe for Branch
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