pub enum KnownPointer {
Show 15 variants
Box,
Rc,
RcWeak,
Arc,
ArcWeak,
Cow,
Pin,
Cell,
RefCell,
OnceCell,
Mutex,
RwLock,
NonNull,
SharedReference,
ExclusiveReference,
}
Expand description
Represents common standard library pointer kinds
Variants§
Box
Box<T>
, heap-allocated values with single ownership
Rc
Rc<T>
, reference-counted values with multiple ownership
RcWeak
Weak<T>
, a weak reference to an Rc
-managed value
Arc
Arc<T>
, thread-safe reference-counted values with multiple ownership
ArcWeak
Weak<T>
, a weak reference to an Arc
-managed value
Cow
Cow<'a, T>
, a clone-on-write smart pointer
Pin
Pin<P>
, a type that pins values behind a pointer
Cell
Cell<T>
, a mutable memory location with interior mutability
RefCell
RefCell<T>
, a mutable memory location with dynamic borrowing rules
OnceCell
OnceCell<T>
, a cell that can be written to only once
Mutex
Mutex<T>
, a mutual exclusion primitive
RwLock
RwLock<T>
, a reader-writer lock
NonNull
NonNull<T>
, a wrapper around a raw pointer that is not null
&T
ExclusiveReference
&mut T
Trait Implementations§
Source§impl Clone for KnownPointer
impl Clone for KnownPointer
Source§fn clone(&self) -> KnownPointer
fn clone(&self) -> KnownPointer
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for KnownPointer
impl Debug for KnownPointer
Source§impl Hash for KnownPointer
impl Hash for KnownPointer
Source§impl PartialEq for KnownPointer
impl PartialEq for KnownPointer
impl Copy for KnownPointer
impl Eq for KnownPointer
impl StructuralPartialEq for KnownPointer
Auto Trait Implementations§
impl Freeze for KnownPointer
impl RefUnwindSafe for KnownPointer
impl Send for KnownPointer
impl Sync for KnownPointer
impl Unpin for KnownPointer
impl UnwindSafe for KnownPointer
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