fidl_fuchsia_ui_focus_ext

Trait FocusChainExt

Source
pub trait FocusChainExt
where Self: Sized,
{ // Required methods fn len(&self) -> usize; fn duplicate(&self) -> Result<Self, Status>; fn koids( &self, ) -> Box<dyn ExactSizeIterator<Item = Result<Koid, Status>> + '_>; fn to_focus_koid_chain(&self) -> Result<FocusKoidChain, Status>; // Provided methods fn is_empty(&self) -> bool { ... } fn equivalent<O: FocusChainExt>(&self, other: &O) -> Result<bool, Status> { ... } }
Expand description

Required Methods§

Source

fn len(&self) -> usize

Returns the number of views in the chain.

Source

fn duplicate(&self) -> Result<Self, Status>

Creates a new chain, in which all of the ViewRefs (or koids) have been duplicated from the original. Returns an error if duplicating any of the ViewRefs fails.

Source

fn koids(&self) -> Box<dyn ExactSizeIterator<Item = Result<Koid, Status>> + '_>

Returns a fallible iterator over the chain’s koids. If any koid cannot be retrieved, the iterator yields an error in its place.

Source

fn to_focus_koid_chain(&self) -> Result<FocusKoidChain, Status>

Converts this chain into a FocusKoidChain, which contains just koids instead of [ViewRef]s.

Provided Methods§

Source

fn is_empty(&self) -> bool

Returns true if there are no views in the chain.

Source

fn equivalent<O: FocusChainExt>(&self, other: &O) -> Result<bool, Status>

Returns true if the two chains’ ViewRefs correspond to the same koids, in the same order. If any of the koids cannot be retrieved, returns an error.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl FocusChainExt for FocusChain

Source§

impl FocusChainExt for FocusKoidChain

Source§

fn duplicate(&self) -> Result<Self, Status>

Clones this FocusKoidChain.

Source§

fn to_focus_koid_chain(&self) -> Result<FocusKoidChain, Status>

Clones this FocusKoidChain.

Source§

fn len(&self) -> usize

Source§

fn koids(&self) -> Box<dyn ExactSizeIterator<Item = Result<Koid, Status>> + '_>

Implementors§