Struct PokeSmartPointer

Source
pub struct PokeSmartPointer<'mem> { /* private fields */ }

Implementations§

Source§

impl<'mem> PokeSmartPointer<'mem>

Source

pub fn shape(&self) -> &'static Shape

Returns the shape for this smart pointer.

Source

pub fn def(&self) -> &SmartPointerDef

Returns the smart pointer definition.

Source

pub fn vtable(&self) -> &'static SmartPointerVTable

Returns the smart pointer vtable

Source

pub fn is_weak(&self) -> bool

Returns whether this smart pointer is weak (like std::sync::Weak).

Source

pub fn is_atomic(&self) -> bool

Returns whether this smart pointer is atomic (like std::sync::Arc).

Source

pub fn is_lock(&self) -> bool

Returns whether this pointer is a lock (like std::sync::Mutex).

Source

pub fn known_type(&self) -> Option<KnownSmartPointer>

Gets the known smart pointer type, if available.

Source

pub fn inner_type(&self) -> &'static Shape

Returns the shape of the inner type of the smart pointer.

Source

pub fn try_borrow(&self) -> Option<PeekValue<'_>>

Attempts to borrow the inner value if the smart pointer supports it.

Source

pub fn try_upgrade(&self) -> Option<Self>

Attempts to upgrade this pointer if it’s a weak reference.

Source

pub fn try_lock(&self) -> Option<Result<PokeSmartPointerWriteGuard<'_>, ()>>

Attempts to lock this pointer if it’s a mutex-like smart pointer.

Source

pub fn try_read(&self) -> Option<Result<PokeSmartPointerReadGuard<'_>, ()>>

Attempts to acquire a read lock on this pointer if it’s a reader-writer lock.

Source

pub fn try_write(&self) -> Option<Result<PokeSmartPointerWriteGuard<'_>, ()>>

Attempts to acquire a write lock on this pointer if it’s a reader-writer lock.

Source

pub fn into_value(self) -> PokeValue<'mem>

Get a reference to the underlying PokeValue

Source

pub fn build_in_place<U: Facet>(self) -> U

Moves U out of this PokeSmartPointer.

Note that U should be something like Arc<T>, Rc<T>, etc.

Auto Trait Implementations§

§

impl<'mem> Freeze for PokeSmartPointer<'mem>

§

impl<'mem> RefUnwindSafe for PokeSmartPointer<'mem>

§

impl<'mem> !Send for PokeSmartPointer<'mem>

§

impl<'mem> !Sync for PokeSmartPointer<'mem>

§

impl<'mem> Unpin for PokeSmartPointer<'mem>

§

impl<'mem> !UnwindSafe for PokeSmartPointer<'mem>

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.