pub struct VersionHistory { /* private fields */ }
Expand description
VersionHistory stores the history of Fuchsia API levels, and lets callers query the support status of API levels and ABI revisions.
Implementations§
Source§impl VersionHistory
impl VersionHistory
Sourcepub const fn new(versions: &'static [Version]) -> Self
pub const fn new(versions: &'static [Version]) -> Self
Outside of tests, callers should use the static [HISTORY] instance. However, for testing purposes, you may want to build your own hermetic “alternate history” that doesn’t change over time.
If you’re not testing versioning in particular, and you just want an API level/ABI revision that works, see [get_example_supported_version_for_tests].
Sourcepub fn get_abi_revision_for_platform_components(&self) -> AbiRevision
pub fn get_abi_revision_for_platform_components(&self) -> AbiRevision
The ABI revision for components and packages that are “part of the platform” and never “move between releases”. For example:
- Packages produced by the platform build have this ABI revision.
- Components which are not packaged but are “part of the platform” nonetheless (e.g. components loaded from bootfs) have this ABI revision.
- Most packages produced by assembly tools have this ABI revision.
- The
update
package is a noteworthy exception, since it “moves between releases”, in that it is produced by assembly tools from one Fuchsia release, and then later read by the OS from a previous release (that is, the one performing the update).
- The
Sourcepub fn get_misleading_version_for_ffx(&self) -> Version
pub fn get_misleading_version_for_ffx(&self) -> Version
ffx currently presents information suggesting that the platform supports a single API level and ABI revision. This is misleading and should be fixed. Until we do, we have to choose a particular Version for ffx to present.
TODO: https://fxbug.dev/326096999 - Remove this, or turn it into something that makes more sense.
Sourcepub fn get_example_supported_version_for_tests(&self) -> Version
pub fn get_example_supported_version_for_tests(&self) -> Version
API level to be used in tests that create components on the fly and need to specify a supported API level or ABI revision, but don’t particularly care which. The returned Version will be consistent within a given build, but may change from build to build.
Sourcepub fn check_api_level_for_build(
&self,
api_level: ApiLevel,
) -> Result<AbiRevision, ApiLevelError>
pub fn check_api_level_for_build( &self, api_level: ApiLevel, ) -> Result<AbiRevision, ApiLevelError>
Check whether the platform supports building components that target the given API level, and if so, returns the ABI revision associated with that API level.
Sourcepub fn check_abi_revision_for_runtime(
&self,
abi_revision: AbiRevision,
) -> Result<(), AbiRevisionError>
pub fn check_abi_revision_for_runtime( &self, abi_revision: AbiRevision, ) -> Result<(), AbiRevisionError>
Check whether the operating system supports running components that target the given ABI revision.
pub fn version_from_api_level(&self, api_level: ApiLevel) -> Option<Version>
Trait Implementations§
Source§impl Debug for VersionHistory
impl Debug for VersionHistory
Source§impl Hash for VersionHistory
impl Hash for VersionHistory
Source§impl Ord for VersionHistory
impl Ord for VersionHistory
Source§fn cmp(&self, other: &VersionHistory) -> Ordering
fn cmp(&self, other: &VersionHistory) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for VersionHistory
impl PartialEq for VersionHistory
Source§impl PartialOrd for VersionHistory
impl PartialOrd for VersionHistory
impl Eq for VersionHistory
impl StructuralPartialEq for VersionHistory
Auto Trait Implementations§
impl Freeze for VersionHistory
impl RefUnwindSafe for VersionHistory
impl Send for VersionHistory
impl Sync for VersionHistory
impl Unpin for VersionHistory
impl UnwindSafe for VersionHistory
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> 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