pub struct RefName(/* private fields */);Expand description
A prikk reference name, such as heads/main, tags/v1, or remotes/heads/main.
stikk keeps a client-side focused ref (design FR-055) as one of these — a preference, never a HEAD. Validation here is deliberately light: prikk is the authority on whether a ref exists and what it points to, so this only rejects the shapes that could not be a ref name at all (empty, control characters), not the namespace policy prikk itself enforces.
Implementations§
Source§impl RefName
impl RefName
Sourcepub fn parse(value: &str) -> Result<Self>
pub fn parse(value: &str) -> Result<Self>
Parse a ref name, rejecting only empty strings and control characters.
§Errors
Returns StikkError::Environment for an empty or control-character-bearing string.
Sourcepub fn is_received(&self) -> bool
pub fn is_received(&self) -> bool
True when this is a received (remotes/…) ref — read-only in prikk until adopted, and
labelled distinctly by the UI (FR-014).
Trait Implementations§
impl Eq for RefName
Source§impl Ord for RefName
impl Ord for RefName
1.21.0 (const: unstable) · 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
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialOrd for RefName
impl PartialOrd 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