Struct SyncPtr

Source
pub struct SyncPtr<T>(/* private fields */);

Implementations§

Source§

impl<T> SyncPtr<T>

Source

pub fn new(val: T) -> Self

Source

pub fn raw(ptr: *const T) -> Self

Source

pub fn null() -> Self

Source

pub fn ptr(&self) -> *const T

Source

pub fn is_null(&self) -> bool

Source

pub fn as_void(self) -> SyncPtr<Void>

Source

pub unsafe fn as_ref(&self) -> Option<&T>

Source

pub unsafe fn as_mut(&mut self) -> Option<&mut T>

Source

pub unsafe fn take(&mut self) -> T

Source§

impl SyncPtr<Void>

Source

pub fn as_type<N>(self) -> SyncPtr<N>

Source

pub unsafe fn as_typed_ref<N>(&self) -> Option<&N>

Source

pub unsafe fn as_typed_mut<N>(&mut self) -> Option<&mut N>

Source

pub unsafe fn take_typed<N>(&mut self) -> N

Trait Implementations§

Source§

impl<T: Debug> Debug for SyncPtr<T>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<T> From<&SyncPtr<T>> for *const T

Source§

fn from(ptr: &SyncPtr<T>) -> Self

Converts to this type from the input type.
Source§

impl<T> From<&mut SyncPtr<T>> for *mut T

Source§

fn from(ptr: &mut SyncPtr<T>) -> Self

Converts to this type from the input type.
Source§

impl<T> From<*const T> for SyncPtr<T>

Source§

fn from(ptr: *const T) -> Self

Converts to this type from the input type.
Source§

impl<T> From<*mut T> for SyncPtr<T>

Source§

fn from(ptr: *mut T) -> Self

Converts to this type from the input type.
Source§

impl<T> From<Box<T>> for SyncPtr<T>

Source§

fn from(bx: Box<T>) -> Self

Converts to this type from the input type.
Source§

impl<T> From<SyncPtr<T>> for *const T

Source§

fn from(ptr: SyncPtr<T>) -> Self

Converts to this type from the input type.
Source§

impl<T> From<SyncPtr<T>> for *mut T

Source§

fn from(ptr: SyncPtr<T>) -> Self

Converts to this type from the input type.
Source§

impl<T: Send> Send for SyncPtr<T>

Source§

impl<T: Sync> Sync for SyncPtr<T>

Auto Trait Implementations§

§

impl<T> Freeze for SyncPtr<T>

§

impl<T> RefUnwindSafe for SyncPtr<T>
where T: RefUnwindSafe,

§

impl<T> Unpin for SyncPtr<T>

§

impl<T> UnwindSafe for SyncPtr<T>
where T: RefUnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.