#[repr(C)]pub struct ViewRef {
pub reference: EventPair,
}Expand description
A ViewRef is a handle to a kernel object which identifies a unique View across the system. Two ViewRefs to the same View have the same KOID.
Clients use a ViewRef to identify a View, to validate a View, and to receive a View invalidation signal.
As part of View creation, the client creates a linked ViewRef/ViewRefControl pair and hands the pair to Scenic (ViewRefControl is described below). The client must remove the ViewRef’s signal capabilities; otherwise the View is not created.
The client may freely clone its ViewRef and share it, even before sending it to Scenic.
Example 1. Accessibility accepts a ViewRef from a client to group the semantic nodes, and semantic operations, associated with a client’s View. It must validate a client’s ViewRef with Scenic.
Example 2. We use ViewRefs to create a FocusChain, which identifies Views considered as “in-focus” down the View hierarchy. When a View is destroyed, Scenic signals to all FocusChain holders that the ViewRef is now invalid.
Fields§
§reference: EventPairTrait Implementations§
Source§impl<___E> Encode<ViewRef, ___E> for ViewRefwhere
___E: InternalHandleEncoder + ?Sized + HandleEncoder,
impl<___E> Encode<ViewRef, ___E> for ViewRefwhere
___E: InternalHandleEncoder + ?Sized + HandleEncoder,
Source§const COPY_OPTIMIZATION: CopyOptimization<Self, ViewRef>
const COPY_OPTIMIZATION: CopyOptimization<Self, ViewRef>
Source§impl<___E> EncodeOption<Box<'static, ViewRef>, ___E> for ViewRef
impl<___E> EncodeOption<Box<'static, ViewRef>, ___E> for ViewRef
Source§fn encode_option(
this: Option<Self>,
encoder: &mut ___E,
out: &mut MaybeUninit<Box<'static, ViewRef>>,
_: (),
) -> Result<(), EncodeError>
fn encode_option( this: Option<Self>, encoder: &mut ___E, out: &mut MaybeUninit<Box<'static, ViewRef>>, _: (), ) -> Result<(), EncodeError>
impl StructuralPartialEq for ViewRef
Auto Trait Implementations§
impl Freeze for ViewRef
impl RefUnwindSafe for ViewRef
impl Send for ViewRef
impl Sync for ViewRef
impl Unpin for ViewRef
impl UnsafeUnpin for ViewRef
impl UnwindSafe for ViewRef
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
§impl<T, W> FromWireOption<Box<'_, W>> for Twhere
T: FromWire<W>,
impl<T, W> FromWireOption<Box<'_, W>> for Twhere
T: FromWire<W>,
§fn from_wire_option(wire: Box<'_, W>) -> Option<T>
fn from_wire_option(wire: Box<'_, W>) -> Option<T>
§impl<T> InstanceFromServiceTransport<T> for T
impl<T> InstanceFromServiceTransport<T> for T
§fn from_service_transport(handle: T) -> T
fn from_service_transport(handle: T) -> T
T to [Self]