pub struct RawPtr<T: ?Sized + 'static> { /* private fields */ }Implementations§
Source§impl<T: 'static + Sized> RawPtr<T>
impl<T: 'static + Sized> RawPtr<T>
pub const fn new(value: &mut T) -> RawPtr<T>
pub const fn null() -> RawPtr<T>
pub const unsafe fn from_raw(raw: *mut T) -> RawPtr<T>
pub unsafe fn alloc() -> RawPtr<T>
pub unsafe fn calloc(amount: usize) -> RawPtr<T>
pub unsafe fn malloc(size: usize) -> RawPtr<T>
pub unsafe fn free(self)
pub const unsafe fn index<'a>(self, index: isize) -> &'a T
pub const unsafe fn index_mut<'a>(self, index: isize) -> &'a mut T
pub const unsafe fn copy_to(self, other: &mut Self)
pub unsafe fn mem_copy_to<D: IntoRawPtr>(self, other: D, size: usize)where
<D as IntoRawPtr>::Pointee: 'static,
pub unsafe fn assign(self, value: T)
pub unsafe fn assign_cast<D: 'static>(self, value: D)
pub unsafe fn assign_check(self, value: T) -> PtrState
pub const fn get_const_raw(self) -> *const T
pub const fn is_null(self) -> bool
pub const unsafe fn as_ref<'a>(self) -> Option<&'a T>
pub const unsafe fn as_mut<'a>(self) -> Option<&'a mut T>
pub const unsafe fn as_raw(self) -> Option<*mut T>
pub const unsafe fn as_const_raw(self) -> Option<*const T>
pub const unsafe fn cast<U>(self) -> RawPtr<U>
pub const unsafe fn cast_ref<'a, U>(self) -> &'a U
pub const unsafe fn cast_mut<'a, U>(self) -> &'a mut U
pub const unsafe fn cast_raw<U>(self) -> *mut U
pub const unsafe fn cast_const_raw<U>(self) -> *const U
pub const unsafe fn to_owned(&self) -> RawPtr<T>
Trait Implementations§
Source§impl<T: Ord + ?Sized + 'static> Ord for RawPtr<T>
impl<T: Ord + ?Sized + 'static> Ord for RawPtr<T>
Source§impl<T: PartialOrd + ?Sized + 'static> PartialOrd for RawPtr<T>
impl<T: PartialOrd + ?Sized + 'static> PartialOrd for RawPtr<T>
impl<T: Copy + ?Sized + 'static> Copy for RawPtr<T>
impl<T: Eq + ?Sized + 'static> Eq for RawPtr<T>
impl<T: ?Sized + 'static> StructuralPartialEq for RawPtr<T>
Auto Trait Implementations§
impl<T> Freeze for RawPtr<T>where
T: ?Sized,
impl<T> RefUnwindSafe for RawPtr<T>where
T: RefUnwindSafe + ?Sized,
impl<T> !Send for RawPtr<T>
impl<T> !Sync for RawPtr<T>
impl<T> Unpin for RawPtr<T>
impl<T> UnwindSafe for RawPtr<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