pub struct PokeSmartPointer<'mem> { /* private fields */ }Implementations§
Source§impl<'mem> PokeSmartPointer<'mem>
impl<'mem> PokeSmartPointer<'mem>
Sourcepub fn def(&self) -> &SmartPointerDef
pub fn def(&self) -> &SmartPointerDef
Returns the smart pointer definition.
Sourcepub fn vtable(&self) -> &'static SmartPointerVTable
pub fn vtable(&self) -> &'static SmartPointerVTable
Returns the smart pointer vtable
Sourcepub fn is_weak(&self) -> bool
pub fn is_weak(&self) -> bool
Returns whether this smart pointer is weak (like std::sync::Weak).
Sourcepub fn is_atomic(&self) -> bool
pub fn is_atomic(&self) -> bool
Returns whether this smart pointer is atomic (like std::sync::Arc).
Sourcepub fn is_lock(&self) -> bool
pub fn is_lock(&self) -> bool
Returns whether this pointer is a lock (like std::sync::Mutex).
Sourcepub fn known_type(&self) -> Option<KnownSmartPointer>
pub fn known_type(&self) -> Option<KnownSmartPointer>
Gets the known smart pointer type, if available.
Sourcepub fn inner_type(&self) -> &'static Shape
pub fn inner_type(&self) -> &'static Shape
Returns the shape of the inner type of the smart pointer.
Sourcepub fn try_borrow(&self) -> Option<PeekValue<'_>>
pub fn try_borrow(&self) -> Option<PeekValue<'_>>
Attempts to borrow the inner value if the smart pointer supports it.
Sourcepub fn try_upgrade(&self) -> Option<Self>
pub fn try_upgrade(&self) -> Option<Self>
Attempts to upgrade this pointer if it’s a weak reference.
Sourcepub fn try_lock(&self) -> Option<Result<PokeSmartPointerWriteGuard<'_>, ()>>
pub fn try_lock(&self) -> Option<Result<PokeSmartPointerWriteGuard<'_>, ()>>
Attempts to lock this pointer if it’s a mutex-like smart pointer.
Sourcepub fn try_read(&self) -> Option<Result<PokeSmartPointerReadGuard<'_>, ()>>
pub fn try_read(&self) -> Option<Result<PokeSmartPointerReadGuard<'_>, ()>>
Attempts to acquire a read lock on this pointer if it’s a reader-writer lock.
Sourcepub fn try_write(&self) -> Option<Result<PokeSmartPointerWriteGuard<'_>, ()>>
pub fn try_write(&self) -> Option<Result<PokeSmartPointerWriteGuard<'_>, ()>>
Attempts to acquire a write lock on this pointer if it’s a reader-writer lock.
Sourcepub fn into_value(self) -> PokeValue<'mem>
pub fn into_value(self) -> PokeValue<'mem>
Get a reference to the underlying PokeValue
Sourcepub fn build_in_place<U: Facet>(self) -> U
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.