#[repr(C)]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§view_ref_control: ViewRefControlTrait Implementations§
Source§impl Debug for ViewIdentityOnCreation
impl Debug for ViewIdentityOnCreation
Source§impl<___E> Encode<ViewIdentityOnCreation, ___E> for ViewIdentityOnCreationwhere
___E: InternalHandleEncoder + ?Sized + HandleEncoder,
impl<___E> Encode<ViewIdentityOnCreation, ___E> for ViewIdentityOnCreationwhere
___E: InternalHandleEncoder + ?Sized + HandleEncoder,
Source§const COPY_OPTIMIZATION: CopyOptimization<Self, ViewIdentityOnCreation>
const COPY_OPTIMIZATION: CopyOptimization<Self, ViewIdentityOnCreation>
Source§fn encode(
self,
encoder_: &mut ___E,
out_: &mut MaybeUninit<ViewIdentityOnCreation>,
_: (),
) -> Result<(), EncodeError>
fn encode( self, encoder_: &mut ___E, out_: &mut MaybeUninit<ViewIdentityOnCreation>, _: (), ) -> Result<(), EncodeError>
Source§impl<___E> EncodeOption<Box<'static, ViewIdentityOnCreation>, ___E> for ViewIdentityOnCreation
impl<___E> EncodeOption<Box<'static, ViewIdentityOnCreation>, ___E> for ViewIdentityOnCreation
Source§fn encode_option(
this: Option<Self>,
encoder: &mut ___E,
out: &mut MaybeUninit<Box<'static, ViewIdentityOnCreation>>,
_: (),
) -> Result<(), EncodeError>
fn encode_option( this: Option<Self>, encoder: &mut ___E, out: &mut MaybeUninit<Box<'static, ViewIdentityOnCreation>>, _: (), ) -> Result<(), EncodeError>
Source§impl FromWire<ViewIdentityOnCreation> for ViewIdentityOnCreation
impl FromWire<ViewIdentityOnCreation> for ViewIdentityOnCreation
Source§const COPY_OPTIMIZATION: CopyOptimization<ViewIdentityOnCreation, Self>
const COPY_OPTIMIZATION: CopyOptimization<ViewIdentityOnCreation, Self>
Source§fn from_wire(wire: ViewIdentityOnCreation) -> Self
fn from_wire(wire: ViewIdentityOnCreation) -> Self
Source§impl PartialEq for ViewIdentityOnCreation
impl PartialEq for ViewIdentityOnCreation
impl StructuralPartialEq for ViewIdentityOnCreation
Auto Trait Implementations§
impl Freeze for ViewIdentityOnCreation
impl RefUnwindSafe for ViewIdentityOnCreation
impl Send for ViewIdentityOnCreation
impl Sync for ViewIdentityOnCreation
impl Unpin for ViewIdentityOnCreation
impl UnsafeUnpin for ViewIdentityOnCreation
impl UnwindSafe for ViewIdentityOnCreation
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]