pub struct VersioningRecord { /* private fields */ }Expand description
Result of analysing the API versioning annotations of a specification.
Implementations§
Source§impl VersioningRecord
impl VersioningRecord
Sourcepub fn analyze(spec: &Specification) -> ParserResult<Option<VersioningRecord>>
pub fn analyze(spec: &Specification) -> ParserResult<Option<VersioningRecord>>
Validates every API versioning annotation of a specification.
Validation always runs, even when no version is projected. Returns
None for specifications without a @version enum, and fails when
lifecycle annotations appear without one.
Sourcepub fn parameter(&self) -> Option<&VersionParameter>
pub fn parameter(&self) -> Option<&VersionParameter>
The wire location and name carried by clients of this version timeline.
Sourcepub fn timeline(&self) -> &VersionTimeline
pub fn timeline(&self) -> &VersionTimeline
The version history declared by the @version enum.
Sourcepub fn member_intervals(
&self,
spec: &Specification,
) -> ParserResult<Vec<MemberInterval>>
pub fn member_intervals( &self, spec: &Specification, ) -> ParserResult<Vec<MemberInterval>>
The existence interval of every versioned declaration, read from the unprojected specification. Version modules carry no lifecycle annotations after projection, so this is the only view the adapter stage can pair versions from.
Sourcepub fn resolve_version(&self, raw: &str) -> ParserResult<VersionId>
pub fn resolve_version(&self, raw: &str) -> ParserResult<VersionId>
Resolves a version member name or display value for a CLI or plugin.
Sourcepub fn project(
&self,
spec: &Specification,
version: VersionId,
) -> ParserResult<Specification>
pub fn project( &self, spec: &Specification, version: VersionId, ) -> ParserResult<Specification>
Projects version into an ordinary specification.
Sourcepub fn merge(
&self,
spec: &Specification,
versions: &[VersionId],
) -> ParserResult<Specification>
pub fn merge( &self, spec: &Specification, versions: &[VersionId], ) -> ParserResult<Specification>
Projects every selected version into one specification with one module per version, in timeline order.