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 handle wrapper 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>
impl<'a, T> Unowned<'a, T>
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>
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>
Get a reference to the handle. One important use of such a reference is
for
object_wait_many.§impl<'a, T> Ord for Unowned<'a, T>where
T: Ord,
impl<'a, T> Ord for Unowned<'a, T>where
T: Ord,
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
§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> UnsafeUnpin for Unowned<'a, T>where
T: UnsafeUnpin,
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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
Converts the given service transport handle of type
T to Self