#[non_exhaustive]pub struct ChildRef {
pub url: String,
pub path: Option<String>,
pub ref: Option<String>,
}Expand description
Reference to a child pack from a children: entry.
path is intentionally left None at parse time — callers that need
the on-disk directory name should invoke ChildRef::effective_path
which extracts the last URL segment as the default.
Marked #[non_exhaustive] so spec growth (e.g. pin, shallow) does
not break library consumers who destructure the struct.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.url: StringUpstream git URL (any scheme gix can resolve).
path: Option<String>Optional override for the on-disk directory name. Preserved as
None when absent so callers can distinguish “defaulted” from
“explicitly set to the default value”.
ref: Option<String>Optional git ref (branch / tag / commit). Serialized as ref: via
the raw-identifier field.
Implementations§
Source§impl ChildRef
impl ChildRef
Sourcepub fn effective_path(&self) -> String
pub fn effective_path(&self) -> String
Resolve the on-disk directory name. When path is explicitly set it
wins; otherwise the last path segment of url (stripped of a
trailing .git) is used.
§Safety precondition (callers MUST validate first)
This method returns its input verbatim — it does not check
for path separators, . / .., the empty string, or other
path-traversal shapes. Callers using the returned string for
any filesystem operation MUST first run plan-phase validation
via PackManifest::validate_plan (which invokes
validate::run_all, including the internal bare-name
validator). The sync orchestrator and the tree walker do this
before dispatch; in-crate callers that reach ChildRef
directly must follow the same discipline.
Validation lives at plan phase — not here — to keep this method side-effect-free and out of the hot dispatch path. Re-running the regex on every call would amount to per-step paranoia for zero added safety, since plan validation already short-circuits the entire walk on a bad child path.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for ChildRef
impl<'de> Deserialize<'de> for ChildRef
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for ChildRef
impl StructuralPartialEq for ChildRef
Auto Trait Implementations§
impl Freeze for ChildRef
impl RefUnwindSafe for ChildRef
impl Send for ChildRef
impl Sync for ChildRef
impl Unpin for ChildRef
impl UnsafeUnpin for ChildRef
impl UnwindSafe for ChildRef
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
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§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.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<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