pub struct LevelDependency {
pub dependency_type: DependencyType,
pub dependent_level: u8,
pub requires_token: Event,
pub requires_level_by_preference: Vec<u8>,
}
Expand description
Describes a dependency from one power element’s level on another power
element’s level.
For example if element PowerElement_A
has a level PowerLevel_A3
which
depends on an element PowerElement_B
being at PowerLevel_B2
where the
dependency is DependencyType::ASSERTIVE
then we would fill out the struct
to convey the meaning:
dependent_level
=PowerLevel_A3
requires_token
=PowerElement_B
,dependency_type =
ASSERTIVE`,requires_level_by_preference
=[PowerLevel_B2]
(Note the values above are only symbolic, eg.dependent_level
requires an integer value, not a string.)
The dependent Element’s identity is not specified in this struct and must be specified as a separate argument in a request or be inferred, perhaps because a channel is scoped to the dependent element.
Fields§
§dependency_type: DependencyType
Must match the expected type of the DependencyToken, i.e. ASSERTIVE must be used if the token is specified to be an assertive dependency token and OPPORTUNISTIC must be used if the token is specified to be an opportunistic dependency token.
dependent_level: u8
The power element level that this LevelDependency
struct declaration
supports. This is level that has a dependency on
requires_level_by_preference
.
requires_token: Event
Must supply a token registered via the RegisterDependencyToken call of the required element’s ElementControl protocol.
requires_level_by_preference: Vec<u8>
A list of levels in decreasing preferential order that power broker should attempt to make required for this dependency to be satisfied. The first level in list that is a valid level will become the required level.
Platform clients can use this list to keep backwards compatibility with dependencies by providing multiple levels that the dependency may have implemented in older API levels.
Trait Implementations§
Source§impl Debug for LevelDependency
impl Debug for LevelDependency
Source§impl Decode<LevelDependency, DefaultFuchsiaResourceDialect> for LevelDependency
impl Decode<LevelDependency, DefaultFuchsiaResourceDialect> for LevelDependency
Source§impl Encode<LevelDependency, DefaultFuchsiaResourceDialect> for &mut LevelDependency
impl Encode<LevelDependency, DefaultFuchsiaResourceDialect> for &mut LevelDependency
Source§impl<T0: Encode<DependencyType, DefaultFuchsiaResourceDialect>, T1: Encode<u8, DefaultFuchsiaResourceDialect>, T2: Encode<HandleType<Event, { _ }, 2147483648>, DefaultFuchsiaResourceDialect>, T3: Encode<Vector<u8, 256>, DefaultFuchsiaResourceDialect>> Encode<LevelDependency, DefaultFuchsiaResourceDialect> for (T0, T1, T2, T3)
impl<T0: Encode<DependencyType, DefaultFuchsiaResourceDialect>, T1: Encode<u8, DefaultFuchsiaResourceDialect>, T2: Encode<HandleType<Event, { _ }, 2147483648>, DefaultFuchsiaResourceDialect>, T3: Encode<Vector<u8, 256>, DefaultFuchsiaResourceDialect>> Encode<LevelDependency, DefaultFuchsiaResourceDialect> for (T0, T1, T2, T3)
Source§impl Hash for LevelDependency
impl Hash for LevelDependency
Source§impl Ord for LevelDependency
impl Ord for LevelDependency
Source§fn cmp(&self, other: &LevelDependency) -> Ordering
fn cmp(&self, other: &LevelDependency) -> 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 LevelDependency
impl PartialEq for LevelDependency
Source§impl PartialOrd for LevelDependency
impl PartialOrd for LevelDependency
Source§impl ResourceTypeMarker for LevelDependency
impl ResourceTypeMarker for LevelDependency
Source§type Borrowed<'a> = &'a mut LevelDependency
type Borrowed<'a> = &'a mut LevelDependency
Encode<Self>
type cheaply obtainable from &mut Self::Owned
. There are three cases: Read moreSource§fn take_or_borrow<'a>(
value: &'a mut <Self as TypeMarker>::Owned,
) -> Self::Borrowed<'a>
fn take_or_borrow<'a>( value: &'a mut <Self as TypeMarker>::Owned, ) -> Self::Borrowed<'a>
&mut Self::Owned
to Self::Borrowed
. For
HandleBased
types this is “take” (it returns an owned handle and
replaces value
with Handle::invalid
), and for all other types it is
“borrow” (just converts from one reference to another).Source§impl TypeMarker for LevelDependency
impl TypeMarker for LevelDependency
Source§type Owned = LevelDependency
type Owned = LevelDependency
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
.§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 more§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.