pub enum NamespaceSpec {
Uri(String),
Table(NamespaceTable),
}Expand description
One namespace declaration. Three on-disk shapes parse into the same logical record:
acme = "github:acme/lex-labels"— bare URI string.acme = { tap = "acme" }— tap shorthand, expands togithub:acme/lex-labels.acme = { uri = "...", rev = "...", subdir = "..." }— full table form.
tap and uri are mutually exclusive on the table form;
having both is a load-time error (see [NamespaceSpec::validate]).
Variants§
Uri(String)
Bare URI string form.
Table(NamespaceTable)
Table form. One of tap / uri must be set; both is an
error.
Implementations§
Source§impl NamespaceSpec
impl NamespaceSpec
Sourcepub fn canonical_uri(&self) -> Result<String, LabelsConfigError>
pub fn canonical_uri(&self) -> Result<String, LabelsConfigError>
Resolve the spec into a single canonical URI string. Tap
shorthand expands to github:<tap>/lex-labels; the table
form’s rev, subdir, and via are appended via fragment +
query (uri#rev?subdir=...&via=git) so the resolver can parse
them uniformly. via = "https" (the default) is intentionally
not encoded — omitting it keeps cache keys stable for the
existing tap-shorthand form (a .lex.toml change from
implicit-default to explicit-https should not invalidate
caches).
Trait Implementations§
Source§impl Clone for NamespaceSpec
impl Clone for NamespaceSpec
Source§fn clone(&self) -> NamespaceSpec
fn clone(&self) -> NamespaceSpec
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 NamespaceSpec
impl Debug for NamespaceSpec
Source§impl<'de> Deserialize<'de> for NamespaceSpec
impl<'de> Deserialize<'de> for NamespaceSpec
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>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for NamespaceSpec
impl RefUnwindSafe for NamespaceSpec
impl Send for NamespaceSpec
impl Sync for NamespaceSpec
impl Unpin for NamespaceSpec
impl UnsafeUnpin for NamespaceSpec
impl UnwindSafe for NamespaceSpec
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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>
Converts
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>
Converts
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