#[repr(u32)]pub enum Availability {
Required = 1,
Optional = 2,
SameAsTarget = 3,
Transitional = 4,
}
Expand description
Describes the expected availability of the capability.
Some capabilities may not be present on all system configurations. In those
cases, the availability will be declared as OPTIONAL
along the chains of
exposes/offers/uses, and the capability would be routed from void
on
system configurations where it does not make sense to route or provide a
particular capability (e.g. graphical capabilities on a headless system).
Variants§
Required = 1
The capability must be available. Failure to route the capability is an error.
Optional = 2
Inside a use declaration: the component can function if it fails to obtain the capability.
Inside an offer/expose declaration: the capability may not be available in some system configurations. As a corollary, the target component must not have a required dependency on the capability.
SameAsTarget = 3
If the target of the corresponding offer or expose declaration requires the capability, then the behavior is equivalent to required. If the target has an optional dependency on the capability, then the behavior is equivalent to optional. This is useful for container components that would like to change their routing availability based on ones inside.
This value is not allowed inside a use declaration.
Transitional = 4
The source may omit the route completely without even having to route
from void
.
[TRANSITIONAL
] is used for soft transitions that introduce new
capabilities.
Implementations§
source§impl Availability
impl Availability
pub fn from_primitive(prim: u32) -> Option<Self>
pub const fn into_primitive(self) -> u32
pub fn is_unknown(&self) -> bool
is_unknown
Trait Implementations§
source§impl Clone for Availability
impl Clone for Availability
source§fn clone(&self) -> Availability
fn clone(&self) -> Availability
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for Availability
impl Debug for Availability
source§impl<D: ResourceDialect> Decode<Availability, D> for Availability
impl<D: ResourceDialect> Decode<Availability, D> for Availability
source§impl<D: ResourceDialect> Encode<Availability, D> for Availability
impl<D: ResourceDialect> Encode<Availability, D> for Availability
source§impl Hash for Availability
impl Hash for Availability
source§impl Ord for Availability
impl Ord for Availability
source§fn cmp(&self, other: &Availability) -> Ordering
fn cmp(&self, other: &Availability) -> 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 Availability
impl PartialEq for Availability
source§fn eq(&self, other: &Availability) -> bool
fn eq(&self, other: &Availability) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for Availability
impl PartialOrd for Availability
source§fn partial_cmp(&self, other: &Availability) -> Option<Ordering>
fn partial_cmp(&self, other: &Availability) -> 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 moresource§impl TypeMarker for Availability
impl TypeMarker for Availability
§type Owned = Availability
type Owned = Availability
source§fn inline_align(_context: Context) -> usize
fn inline_align(_context: Context) -> usize
source§fn inline_size(_context: Context) -> usize
fn inline_size(_context: Context) -> usize
inline_align
.source§fn encode_is_copy() -> bool
fn encode_is_copy() -> bool
Self::Owned
matches the FIDL wire
format and encoding requires no validation. When true, we can optimize
encoding arrays and vectors of Self::Owned
to a single memcpy. Read moresource§fn decode_is_copy() -> bool
fn decode_is_copy() -> bool
Self::Owned
matches the FIDL wire
format and decoding requires no validation. When true, we can optimize
decoding arrays and vectors of Self::Owned
to a single memcpy.source§impl ValueTypeMarker for Availability
impl ValueTypeMarker for Availability
§type Borrowed<'a> = Availability
type Borrowed<'a> = Availability
Encode<Self>
type cheaply obtainable from &Self::Owned
. There are three cases: Read moreimpl Copy for Availability
impl Eq for Availability
impl StructuralPartialEq for Availability
Auto Trait Implementations§
impl Freeze for Availability
impl RefUnwindSafe for Availability
impl Send for Availability
impl Sync for Availability
impl Unpin for Availability
impl UnwindSafe for Availability
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)source§impl<T> CloneToUninit for Twhere
T: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)