pub struct Out<'a, T: ?Sized> { /* private fields */ }Expand description
Wrapper for write-only “out pointers” that are safe to write to
Implementations§
Source§impl<'a, T: ?Sized> Out<'a, T>
impl<'a, T: ?Sized> Out<'a, T>
Sourcepub unsafe fn nullable(ptr: *mut T) -> Option<Self>
pub unsafe fn nullable(ptr: *mut T) -> Option<Self>
§Safety
- pointer must either be NULL, or be valid for the duration of lifetime
'a
Sourcepub unsafe fn nonnull(ptr: *mut T) -> Self
pub unsafe fn nonnull(ptr: *mut T) -> Self
§Safety
- pointer must be valid for the duration of lifetime
'a
pub fn from_mut(r: &'a mut T) -> Self
pub fn as_mut_ptr(&mut self) -> *mut T
Source§impl<'a, T> Out<'a, T>
impl<'a, T> Out<'a, T>
pub fn from_uninit_mut(r: &'a mut MaybeUninit<T>) -> Self
pub fn write(&mut self, t: T)
Source§impl<'a, T, const N: usize> Out<'a, [T; N]>
impl<'a, T, const N: usize> Out<'a, [T; N]>
pub fn as_slice_mut<'b>(&'b mut self) -> Out<'b, [T]>
Source§impl<'a, T> Out<'a, [T]>
impl<'a, T> Out<'a, [T]>
Sourcepub unsafe fn from_raw_parts(ptr: *mut T, len: usize) -> Self
pub unsafe fn from_raw_parts(ptr: *mut T, len: usize) -> Self
§Safety
If len > 0, ptr be valid for len elements of T, during lifetime 'a.
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn split_at_checked<'b>(&'b mut self, n: usize) -> Option<[Out<'b, [T]>; 2]>
pub fn copy_from_slice(&mut self, src: &[T])where
T: Copy,
pub fn copy_common_length_from_slice(&mut self, src: &[T]) -> usizewhere
T: Copy,
pub fn subslice<'b>(&'b mut self, start: usize, end: usize) -> Out<'b, [T]>
pub fn index<'b>(&'b mut self, i: usize) -> Out<'b, T>
Trait Implementations§
Source§impl<'a, T: Ord + ?Sized> Ord for Out<'a, T>
impl<'a, T: Ord + ?Sized> Ord for Out<'a, T>
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
Source§impl<'a, T: PartialEq + ?Sized> PartialEq for Out<'a, T>
impl<'a, T: PartialEq + ?Sized> PartialEq for Out<'a, T>
Source§impl<'a, T: PartialOrd + ?Sized> PartialOrd for Out<'a, T>
impl<'a, T: PartialOrd + ?Sized> PartialOrd for Out<'a, T>
impl<'a, T: Eq + ?Sized> Eq for Out<'a, T>
impl<'a, T: ?Sized> StructuralPartialEq for Out<'a, T>
Auto Trait Implementations§
impl<'a, T> Freeze for Out<'a, T>where
T: ?Sized,
impl<'a, T> !RefUnwindSafe for Out<'a, T>
impl<'a, T> !Send for Out<'a, T>
impl<'a, T> !Sync for Out<'a, T>
impl<'a, T> Unpin for Out<'a, T>where
T: ?Sized,
impl<'a, T> UnsafeUnpin for Out<'a, T>where
T: ?Sized,
impl<'a, T> !UnwindSafe for Out<'a, T>
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