pub struct ViewRefControl {
pub reference: EventPair,
}
Expand description
A ViewRefControl is the peer to a ViewRef. Their reference
s are linked.
Like ViewRef, a ViewRefControl is a typed handle to an eventpair. Unlike
ViewRef, a ViewRefControl’s handle is unique. Scenic uses this property
when it ties a ViewRefControl to a View, arranged to share fate. When a
View is destroyed, the associated destruction of its ViewRefControl
triggers an automatic ZX_EVENTPAIR_PEER_CLOSED
signal sent to all ViewRef
holders; hence ViewRef holders may track View lifetime.
As part of View creation, the client creates a linked ViewRef/ViewRefControl pair and hands the pair to Scenic (ViewRef is described above). The client must not clone the ViewRefControl. It must not remove or modify the ViewRefControl’s capabilities; otherwise the View is not created.
Fields§
§reference: EventPair
Trait Implementations§
Source§impl Debug for ViewRefControl
impl Debug for ViewRefControl
Source§impl Decode<ViewRefControl, DefaultFuchsiaResourceDialect> for ViewRefControl
impl Decode<ViewRefControl, DefaultFuchsiaResourceDialect> for ViewRefControl
Source§impl Encode<ViewRefControl, DefaultFuchsiaResourceDialect> for &mut ViewRefControl
impl Encode<ViewRefControl, DefaultFuchsiaResourceDialect> for &mut ViewRefControl
Source§impl<T0: Encode<HandleType<EventPair, { _ }, 2147483648>, DefaultFuchsiaResourceDialect>> Encode<ViewRefControl, DefaultFuchsiaResourceDialect> for (T0,)
impl<T0: Encode<HandleType<EventPair, { _ }, 2147483648>, DefaultFuchsiaResourceDialect>> Encode<ViewRefControl, DefaultFuchsiaResourceDialect> for (T0,)
Source§impl Hash for ViewRefControl
impl Hash for ViewRefControl
Source§impl Ord for ViewRefControl
impl Ord for ViewRefControl
Source§fn cmp(&self, other: &ViewRefControl) -> Ordering
fn cmp(&self, other: &ViewRefControl) -> 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 ViewRefControl
impl PartialEq for ViewRefControl
Source§impl PartialOrd for ViewRefControl
impl PartialOrd for ViewRefControl
Source§impl ResourceTypeMarker for ViewRefControl
impl ResourceTypeMarker for ViewRefControl
Source§type Borrowed<'a> = &'a mut ViewRefControl
type Borrowed<'a> = &'a mut ViewRefControl
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 ViewRefControl
impl TypeMarker for ViewRefControl
Source§type Owned = ViewRefControl
type Owned = ViewRefControl
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.