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.