pub struct SpecRef {
pub repository: Option<RepositoryQualifier>,
pub name: String,
pub effective: Option<DateTimeValue>,
pub repository_span: Option<Span>,
pub target_span: Option<Span>,
}Expand description
A spec reference written in source.
name is the bare spec name (no @, no dots, no slashes).
SpecRef::repository is None for same-repository references, or
Some(RepositoryQualifier) when a repository qualifier was written before the spec name.
effective carries an optional explicit pin written next to the spec name.
Fields§
§repository: Option<RepositoryQualifier>Optional explicit repository qualifier. None means the reference resolves against
the consumer spec’s own repository.
name: StringThe spec name.
effective: Option<DateTimeValue>Optional explicit effective datetime pin written in source.
repository_span: Option<Span>Source span of the repository qualifier (when repository is present).
target_span: Option<Span>Source span of name and optional effective.
Implementations§
Source§impl SpecRef
impl SpecRef
Sourcepub fn same_repository(name: impl Into<String>) -> Self
pub fn same_repository(name: impl Into<String>) -> Self
Same-repository reference: resolution uses the consumer’s repository.
Sourcepub fn cross_repository(
name: impl Into<String>,
qualifier: RepositoryQualifier,
) -> Self
pub fn cross_repository( name: impl Into<String>, qualifier: RepositoryQualifier, ) -> Self
Cross-repository reference with an explicit repository qualifier.
Sourcepub fn at(&self, effective: &EffectiveDate) -> EffectiveDate
pub fn at(&self, effective: &EffectiveDate) -> EffectiveDate
Resolve the effective instant for this reference given the planning slice’s effective.
Explicit qualifier on the reference wins; otherwise inherits the slice instant.