#[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§impl PartialOrd for Availability
impl PartialOrd for Availability
Source§impl TypeMarker for Availability
impl TypeMarker for Availability
Source§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
Source§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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)