pub struct ViewIdentityOnCreation {
pub view_ref: ViewRef,
pub view_ref_control: ViewRefControl,
}
Expand description
Convenience data type to self-identify the view, during view creation.
A ViewRef is used to identify the view, and can be freely cloned and distributed to other components.
A ViewRefControl is used to implement lifecycle notification, and must not
be cloned, and cannot be distributed to other components. Scenic binds the
ViewRefControl object to the view, so when the view is destroyed, the
destruction of the ViewRefControl triggers a ZX_EVENTPAIR_PEER_CLOSED
signal to all ViewRef holders, thus notifying view death.
Usage: When creating a view, place a ViewRef and ViewRefControl together in this struct, so that they travel as a unit to the destination component. This convenience struct allows a protocol author to describe this traveling pair as one argument. It improves readability and reduces mishandling.
Fields§
§view_ref: ViewRef
Stable identifier for the view to be created.
view_ref_control: ViewRefControl
A mechanism for lifecycle notification.
Trait Implementations§
Source§impl Debug for ViewIdentityOnCreation
impl Debug for ViewIdentityOnCreation
Source§impl Decode<ViewIdentityOnCreation, DefaultFuchsiaResourceDialect> for ViewIdentityOnCreation
impl Decode<ViewIdentityOnCreation, DefaultFuchsiaResourceDialect> for ViewIdentityOnCreation
Source§impl Encode<ViewIdentityOnCreation, DefaultFuchsiaResourceDialect> for &mut ViewIdentityOnCreation
impl Encode<ViewIdentityOnCreation, DefaultFuchsiaResourceDialect> for &mut ViewIdentityOnCreation
Source§impl<T0: Encode<ViewRef, DefaultFuchsiaResourceDialect>, T1: Encode<ViewRefControl, DefaultFuchsiaResourceDialect>> Encode<ViewIdentityOnCreation, DefaultFuchsiaResourceDialect> for (T0, T1)
impl<T0: Encode<ViewRef, DefaultFuchsiaResourceDialect>, T1: Encode<ViewRefControl, DefaultFuchsiaResourceDialect>> Encode<ViewIdentityOnCreation, DefaultFuchsiaResourceDialect> for (T0, T1)
Source§impl Hash for ViewIdentityOnCreation
impl Hash for ViewIdentityOnCreation
Source§impl Ord for ViewIdentityOnCreation
impl Ord for ViewIdentityOnCreation
Source§fn cmp(&self, other: &ViewIdentityOnCreation) -> Ordering
fn cmp(&self, other: &ViewIdentityOnCreation) -> 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 ViewIdentityOnCreation
impl PartialEq for ViewIdentityOnCreation
Source§impl PartialOrd for ViewIdentityOnCreation
impl PartialOrd for ViewIdentityOnCreation
Source§impl ResourceTypeMarker for ViewIdentityOnCreation
impl ResourceTypeMarker for ViewIdentityOnCreation
Source§type Borrowed<'a> = &'a mut ViewIdentityOnCreation
type Borrowed<'a> = &'a mut ViewIdentityOnCreation
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 ViewIdentityOnCreation
impl TypeMarker for ViewIdentityOnCreation
Source§type Owned = ViewIdentityOnCreation
type Owned = ViewIdentityOnCreation
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.