[][src]Struct out_reference::Out

#[repr(transparent)]pub struct Out<'a, T: ?Sized>(_, _);

An Out Reference, you can only write to this reference using the set method and reborrow this reference with the borrow method. It isn't safe to read from an Out pointer.

Implementations

impl<'a, T> Out<'a, T>[src]

pub fn from_maybe_uninit(maybe_uninit: &mut MaybeUninit<T>) -> Out<'_, T>[src]

To allow writing to the value inside the MaybeUninit

impl<'a, T: ?Sized> Out<'a, T>[src]

pub fn from_mut(value: &'a mut T) -> Self[src]

Create Out from exclusive reference

pub unsafe fn from_raw(ptr: *mut T) -> Out<'a, T>[src]

Create Out from raw pointer

pub fn borrow(&mut self) -> Out<'_, T>[src]

Reborrows the Out reference

pub fn into_raw(self) -> *mut T[src]

Convert this Out reference into a raw pointer

see as_mut_ptr for safety documentation of the this pointer.

pub fn as_mut_ptr(&mut self) -> *mut T[src]

Get a raw pointer to the Out, it is only safe to write to this pointer unless specified otherwise by the creator of this Out reference

i.e. it's safe to read to an Out<'_, T> that was created from a &mut T and it's safe to read from a Out<'_, T> that was created from a &mut MaybeUninit<T> after it has been initialized.

impl<'a, T> Out<'a, T>[src]

pub fn set(&mut self, value: T)[src]

Set the value behind the Out reference *without dropping the old value *

Trait Implementations

impl<'a, T: Debug + ?Sized> Debug for Out<'a, T>[src]

impl<'a, T> From<&'a mut MaybeUninit<T>> for Out<'a, T>[src]

impl<'a, T: ?Sized> From<&'a mut T> for Out<'a, T>[src]

Auto Trait Implementations

impl<'a, T: ?Sized> RefUnwindSafe for Out<'a, T> where
    T: RefUnwindSafe
[src]

impl<'a, T> !Send for Out<'a, T>[src]

impl<'a, T> !Sync for Out<'a, T>[src]

impl<'a, T: ?Sized> Unpin for Out<'a, T>[src]

impl<'a, T> !UnwindSafe for Out<'a, T>[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> OutMethod for T where
    T: ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.