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 when no from <qualifier> clause was written
(same-repository reference) or Some(RepositoryQualifier) carrying the textual
qualifier the parser observed.
effective carries an optional explicit pin written next to the spec name.
Fields§
§repository: Option<RepositoryQualifier>Optional explicit from <repository_qualifier> clause. 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 (no from clause): 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 from 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.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for SpecRef
impl<'de> Deserialize<'de> for SpecRef
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 StructuralPartialEq for SpecRef
Auto Trait Implementations§
impl Freeze for SpecRef
impl RefUnwindSafe for SpecRef
impl Send for SpecRef
impl Sync for SpecRef
impl Unpin for SpecRef
impl UnsafeUnpin for SpecRef
impl UnwindSafe for SpecRef
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<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