pub struct RemoteName(/* private fields */);Expand description
A validated remote cache name: a single path segment safe to join under
.khive/kg/remotes/ without escaping that directory.
Construct via RemoteName::parse. There is no public way to build a
RemoteName that fails validation, so a RemoteConfig can never carry an
unsafe name into run_sync_remote (VCS-AUD-002).
Implementations§
Source§impl RemoteName
impl RemoteName
Sourcepub fn parse(raw: impl Into<String>) -> Result<Self, VcsError>
pub fn parse(raw: impl Into<String>) -> Result<Self, VcsError>
Validate raw as a safe single-path-segment remote name.
Rejects: empty strings, ., .., any name containing / or \, and
any character outside [A-Za-z0-9._-]. Because path separators are
rejected outright, an absolute path (Unix /root, Windows C:\root)
can never pass — : is also outside the allowed character set.
Trait Implementations§
Source§impl Clone for RemoteName
impl Clone for RemoteName
Source§fn clone(&self) -> RemoteName
fn clone(&self) -> RemoteName
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for RemoteName
Renders exactly like a plain String’s Debug (quoted), so existing
{:?}-formatted error messages that embedded remote.name keep the same
shape after the String -> RemoteName migration.
impl Debug for RemoteName
Renders exactly like a plain String’s Debug (quoted), so existing
{:?}-formatted error messages that embedded remote.name keep the same
shape after the String -> RemoteName migration.
Source§impl Display for RemoteName
impl Display for RemoteName
impl Eq for RemoteName
Source§impl Hash for RemoteName
impl Hash for RemoteName
Source§impl PartialEq for RemoteName
impl PartialEq for RemoteName
impl StructuralPartialEq for RemoteName
Auto Trait Implementations§
impl Freeze for RemoteName
impl RefUnwindSafe for RemoteName
impl Send for RemoteName
impl Sync for RemoteName
impl Unpin for RemoteName
impl UnsafeUnpin for RemoteName
impl UnwindSafe for RemoteName
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more