pub struct GitBranchName(/* private fields */);Expand description
A validated branch name.
Implementations§
Source§impl GitBranchName
impl GitBranchName
Sourcepub fn new(value: impl AsRef<str>) -> Result<Self, GitBranchNameError>
pub fn new(value: impl AsRef<str>) -> Result<Self, GitBranchNameError>
Creates a branch name from text.
§Errors
Returns GitBranchNameError when the branch name is empty or invalid.
Sourcepub fn is_mainline(&self) -> bool
pub fn is_mainline(&self) -> bool
Returns true for common mainline names.
Sourcepub fn is_feature(&self) -> bool
pub fn is_feature(&self) -> bool
Returns true for feature branch spellings.
Sourcepub fn is_release(&self) -> bool
pub fn is_release(&self) -> bool
Returns true for release branch spellings.
Sourcepub fn into_string(self) -> String
pub fn into_string(self) -> String
Consumes the branch name and returns owned text.
Trait Implementations§
Source§impl AsRef<str> for GitBranchName
impl AsRef<str> for GitBranchName
Source§impl Clone for GitBranchName
impl Clone for GitBranchName
Source§fn clone(&self) -> GitBranchName
fn clone(&self) -> GitBranchName
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for GitBranchName
impl Debug for GitBranchName
Source§impl Display for GitBranchName
impl Display for GitBranchName
Source§impl FromStr for GitBranchName
impl FromStr for GitBranchName
Source§impl Hash for GitBranchName
impl Hash for GitBranchName
Source§impl Ord for GitBranchName
impl Ord for GitBranchName
Source§fn cmp(&self, other: &GitBranchName) -> Ordering
fn cmp(&self, other: &GitBranchName) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for GitBranchName
impl PartialEq for GitBranchName
Source§impl PartialOrd for GitBranchName
impl PartialOrd for GitBranchName
Source§impl TryFrom<&str> for GitBranchName
impl TryFrom<&str> for GitBranchName
impl Eq for GitBranchName
impl StructuralPartialEq for GitBranchName
Auto Trait Implementations§
impl Freeze for GitBranchName
impl RefUnwindSafe for GitBranchName
impl Send for GitBranchName
impl Sync for GitBranchName
impl Unpin for GitBranchName
impl UnsafeUnpin for GitBranchName
impl UnwindSafe for GitBranchName
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