Struct version_history::VersionHistory
source · 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§fn eq(&self, other: &VersionHistory) -> bool
fn eq(&self, other: &VersionHistory) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for VersionHistory
impl PartialOrd for VersionHistory
source§fn partial_cmp(&self, other: &VersionHistory) -> Option<Ordering>
fn partial_cmp(&self, other: &VersionHistory) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read more