pub enum Versions {
Lockstep {
version: Version,
},
Versioned {
supported_versions: SupportedVersions,
},
}Expand description
Describes how an API is versioned
Variants§
Lockstep
There is only ever one version of this API
Clients and servers are updated at runtime in lockstep.
Versioned
There are multiple supported versions of this API
Clients and servers may be updated independently of each other. Other parts of the system may constrain things so that either clients or servers are always updated first, but this tool does not assume that.
Fields
§
supported_versions: SupportedVersionsImplementations§
Source§impl Versions
impl Versions
Sourcepub fn new_lockstep(version: Version) -> Versions
pub fn new_lockstep(version: Version) -> Versions
Constructor for a lockstep API
Sourcepub fn new_versioned(supported_versions: SupportedVersions) -> Versions
pub fn new_versioned(supported_versions: SupportedVersions) -> Versions
Constructor for a versioned API
Sourcepub fn is_versioned(&self) -> bool
pub fn is_versioned(&self) -> bool
Returns whether this API is versioned (as opposed to lockstep)
Sourcepub fn is_lockstep(&self) -> bool
pub fn is_lockstep(&self) -> bool
Returns whether this API is lockstep (as opposed to versioned)
Sourcepub fn iter_versions_semvers(&self) -> IterVersionsSemvers<'_> ⓘ
pub fn iter_versions_semvers(&self) -> IterVersionsSemvers<'_> ⓘ
Iterate over the semver versions of an API that are supported
Sourcepub fn iter_versioned_versions(
&self,
) -> Option<impl Iterator<Item = &SupportedVersion> + '_>
pub fn iter_versioned_versions( &self, ) -> Option<impl Iterator<Item = &SupportedVersion> + '_>
For versioned APIs only, iterate over the SupportedVersions
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Versions
impl RefUnwindSafe for Versions
impl Send for Versions
impl Sync for Versions
impl Unpin for Versions
impl UnwindSafe for Versions
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