pub struct Owned<T, Init = T> { /* private fields */ }
Expand description
A struct representing ownership of a pointer to a value of type T
.
Init
represents the initialization state of the value.
Implementations§
Source§impl<T> Owned<T>
impl<T> Owned<T>
Sourcepub fn new_uninit() -> Owned<MaybeUninit<T>, T>
pub fn new_uninit() -> Owned<MaybeUninit<T>, T>
Creates a new uninitialized Owned
instance.
§Safety
The created instance contains uninitialized memory, and should be properly initialized before use.
Sourcepub unsafe fn assume_init(definitely_init: Owned<MaybeUninit<T>, T>) -> Owned<T>
pub unsafe fn assume_init(definitely_init: Owned<MaybeUninit<T>, T>) -> Owned<T>
Converts an uninitialized Owned
instance to an initialized one.
§Safety
The caller must ensure that definitely_init
is properly initialized.
Trait Implementations§
Auto Trait Implementations§
impl<T, Init> Freeze for Owned<T, Init>
impl<T, Init> RefUnwindSafe for Owned<T, Init>where
T: RefUnwindSafe,
Init: RefUnwindSafe,
impl<T, Init = T> !Send for Owned<T, Init>
impl<T, Init = T> !Sync for Owned<T, Init>
impl<T, Init> Unpin for Owned<T, Init>
impl<T, Init> UnwindSafe for Owned<T, Init>where
T: RefUnwindSafe,
Init: 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