Skip to main content

HostChannelCapabilities

Struct HostChannelCapabilities 

Source
pub struct HostChannelCapabilities { /* private fields */ }
Expand description

Host-declared channel capability matrix unifying HarmonyOS, Wearables, MiniApps, and QuickApps.

Implementations§

Source§

impl HostChannelCapabilities

Host-declared channel capability, single-channel non-probing, visual-equivalence gate, and simulated-profile honesty helpers.

Source

pub fn from_host_declaration( host_name: &'static str, supported_channels: Vec<HostRenderChannel>, preferred_channel: HostRenderChannel, visual_equivalence: HostVisualEquivalenceGate, simulated_profile: bool, direct_gpu_verified_on_device: bool, ) -> Self

Constructs a validated HostChannelCapabilities enforcing single-channel non-probing and simulated-profile honesty.

Whenever simulated_profile is true, direct_gpu_verified_on_device is unconditionally forced to false.

§Arguments
  • &'static str - Lowercase host or vendor runtime name.
  • Vec<HostRenderChannel> - Host-declared supported rendering channels.
  • HostRenderChannel - Preferred rendering channel.
  • HostVisualEquivalenceGate - Visual-equivalence invariant gate.
  • bool - Whether this profile is simulated/off-device.
  • bool - Whether direct GPU presentation was verified on a real physical device.
§Returns
  • Self - Validated capability descriptor.
Source

pub fn is_single_channel(&self) -> bool

Returns true when the host declares at most one rendering channel (strictly prohibiting alternate-mode probing).

§Returns
  • bool - true when locked to a single channel.
Source

pub fn can_probe_alternate_channels(&self) -> bool

Returns true iff alternate rendering channels may be probed (supported_channels.len() > 1 and visually equivalent).

§Returns
  • bool - false for single-channel hosts or when visual equivalence fails.
Source

pub fn probe_candidates(&self) -> Vec<HostRenderChannel>

Returns the ordered list of alternate channels eligible for probing (ALWAYS empty when supported_channels.len() <= 1).

§Returns
  • Vec<HostRenderChannel> - Empty for single-channel hosts or visual-equivalence failures.
Source

pub fn select_channel( &self, requested: Option<HostRenderChannel>, ) -> HostChannelSelection

Resolves a channel selection honoring single-channel locks, visual-equivalence gating, and simulated-profile honesty.

§Arguments
  • Option<HostRenderChannel> - Optional requested channel override.
§Returns
  • HostChannelSelection - Resolved channel selection and honesty flags.
Source§

impl HostChannelCapabilities

Source

pub fn get_host_name(&self) -> &'static str

Source

pub fn get_mut_host_name(&mut self) -> &mut &'static str

Source

pub fn set_host_name(&mut self, val: &'static str) -> &mut Self

Source

pub fn get_supported_channels(&self) -> &Vec<HostRenderChannel>

Source

pub fn get_mut_supported_channels(&mut self) -> &mut Vec<HostRenderChannel>

Source

pub fn set_supported_channels( &mut self, val: Vec<HostRenderChannel>, ) -> &mut Self

Source

pub fn get_preferred_channel(&self) -> HostRenderChannel

Source

pub fn get_mut_preferred_channel(&mut self) -> &mut HostRenderChannel

Source

pub fn set_preferred_channel(&mut self, val: HostRenderChannel) -> &mut Self

Source

pub fn get_visual_equivalence(&self) -> HostVisualEquivalenceGate

Source

pub fn get_mut_visual_equivalence(&mut self) -> &mut HostVisualEquivalenceGate

Source

pub fn set_visual_equivalence( &mut self, val: HostVisualEquivalenceGate, ) -> &mut Self

Source

pub fn get_simulated_profile(&self) -> bool

Source

pub fn get_mut_simulated_profile(&mut self) -> &mut bool

Source

pub fn set_simulated_profile(&mut self, val: bool) -> &mut Self

Source

pub fn get_direct_gpu_verified_on_device(&self) -> bool

Source

pub fn get_mut_direct_gpu_verified_on_device(&mut self) -> &mut bool

Source

pub fn set_direct_gpu_verified_on_device(&mut self, val: bool) -> &mut Self

Trait Implementations§

Source§

impl Clone for HostChannelCapabilities

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for HostChannelCapabilities

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for HostChannelCapabilities

Source§

impl PartialEq for HostChannelCapabilities

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for HostChannelCapabilities

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.