pub struct RefName(/* private fields */);Expand description
A pre-validated git reference name (branch/tag/remote), for callers that
accept names from untrusted input (UIs, bots, agents) and want to fail
early with a clear error. The dir-taking methods stay &str — they apply
the same flag-injection guard internally — so this type is optional
up-front validation, not a required wrapper.
Rules follow the load-bearing core of git check-ref-format: non-empty,
no leading - or ., no .., no control characters or space, none of
~ ^ : ? * [ \, no trailing / or .lock.
Implementations§
Trait Implementations§
impl Eq for RefName
impl StructuralPartialEq for RefName
Auto Trait Implementations§
impl Freeze for RefName
impl RefUnwindSafe for RefName
impl Send for RefName
impl Sync for RefName
impl Unpin for RefName
impl UnsafeUnpin for RefName
impl UnwindSafe for RefName
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