Struct Unowned
pub struct Unowned<'a, T> { /* private fields */ }Expand description
A borrowed value of type T.
This is primarily used for working with borrowed values of HandleBased types.
Implementations§
§impl<'a, T> Unowned<'a, T>where
T: Into<NullableHandle>,
impl<'a, T> Unowned<'a, T>where
T: Into<NullableHandle>,
§impl<'a, T> Unowned<'a, T>where
T: HandleBased,
impl<'a, T> Unowned<'a, T>where
T: HandleBased,
pub unsafe fn from_raw_handle(handle: u32) -> Unowned<'a, T>
pub unsafe fn from_raw_handle(handle: u32) -> Unowned<'a, T>
Create a HandleRef from a raw handle. Use this method when you are given a raw handle but
should not take ownership of it. Examples include process-global handles like the root
VMAR. This method should be called with an explicitly provided lifetime that must not
outlive the lifetime during which the handle is owned by the current process. It is unsafe
because most of the time, it is better to use a Handle to prevent leaking resources.
§Safety
handle must be a valid handle (i.e. not dangling), or
ZX_HANDLE_INVALID. If handle is a valid handle, then it must not be
closed for the lifetime 'a.
pub fn raw_handle(&self) -> u32
pub fn raw_handle(&self) -> u32
Returns the raw handle’s integer value.
§impl<'a> Unowned<'a, NullableHandle>
impl<'a> Unowned<'a, NullableHandle>
pub fn cast<T>(self) -> Unowned<'a, T>where
T: HandleBased,
pub fn cast<T>(self) -> Unowned<'a, T>where
T: HandleBased,
Convert this HandleRef to one of a specific type.
Trait Implementations§
§impl<'a, T> AsHandleRef for Unowned<'a, T>where
T: AsHandleRef,
impl<'a, T> AsHandleRef for Unowned<'a, T>where
T: AsHandleRef,
§fn as_handle_ref(&self) -> Unowned<'_, NullableHandle>
fn as_handle_ref(&self) -> Unowned<'_, NullableHandle>
object_wait_many.§fn raw_handle(&self) -> u32
fn raw_handle(&self) -> u32
§fn wait_async_handle(
&self,
port: &Port,
key: u64,
signals: Signals,
options: WaitAsyncOpts,
) -> Result<(), Status>
fn wait_async_handle( &self, port: &Port, key: u64, signals: Signals, options: WaitAsyncOpts, ) -> Result<(), Status>
§fn get_name(&self) -> Result<Name, Status>
fn get_name(&self) -> Result<Name, Status>
§fn set_name(&self, name: &Name) -> Result<(), Status>
fn set_name(&self, name: &Name) -> Result<(), Status>
§fn basic_info(&self) -> Result<HandleBasicInfo, Status>
fn basic_info(&self) -> Result<HandleBasicInfo, Status>
§fn count_info(&self) -> Result<HandleCountInfo, Status>
fn count_info(&self) -> Result<HandleCountInfo, Status>
§impl<T> Clone for Unowned<'_, T>where
T: HandleBased,
impl<T> Clone for Unowned<'_, T>where
T: HandleBased,
§impl<'a, T> Deref for Unowned<'a, T>where
T: Into<NullableHandle>,
impl<'a, T> Deref for Unowned<'a, T>where
T: Into<NullableHandle>,
§impl<'a, T> Ord for Unowned<'a, T>where
T: Ord,
impl<'a, T> Ord for Unowned<'a, T>where
T: Ord,
§impl<'a, T> PartialOrd for Unowned<'a, T>where
T: PartialOrd,
impl<'a, T> PartialOrd for Unowned<'a, T>where
T: PartialOrd,
impl<'a, T> Eq for Unowned<'a, T>where
T: Eq,
impl<'a, T> StructuralPartialEq for Unowned<'a, T>
Auto Trait Implementations§
impl<'a, T> Freeze for Unowned<'a, T>where
T: Freeze,
impl<'a, T> RefUnwindSafe for Unowned<'a, T>where
T: RefUnwindSafe,
impl<'a, T> Send for Unowned<'a, T>
impl<'a, T> Sync for Unowned<'a, T>where
T: Sync,
impl<'a, T> Unpin for Unowned<'a, T>where
T: Unpin,
impl<'a, T> UnwindSafe for Unowned<'a, T>where
T: UnwindSafe + RefUnwindSafe,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
§impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
Source§impl<T> InstanceFromServiceTransport<T> for T
impl<T> InstanceFromServiceTransport<T> for T
Source§fn from_service_transport(handle: T) -> T
fn from_service_transport(handle: T) -> T
T to Self