#[non_exhaustive]pub enum KnownSmartPointer {
Show 13 variants
Box,
Rc,
RcWeak,
Arc,
ArcWeak,
Cow,
Pin,
Cell,
RefCell,
OnceCell,
Mutex,
RwLock,
NonNull,
}Expand description
Represents common standard library smart pointer kinds
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future 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
Trait Implementations§
Source§impl Clone for KnownSmartPointer
impl Clone for KnownSmartPointer
Source§fn clone(&self) -> KnownSmartPointer
fn clone(&self) -> KnownSmartPointer
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 KnownSmartPointer
impl Debug for KnownSmartPointer
Source§impl Hash for KnownSmartPointer
impl Hash for KnownSmartPointer
Source§impl PartialEq for KnownSmartPointer
impl PartialEq for KnownSmartPointer
impl Copy for KnownSmartPointer
impl Eq for KnownSmartPointer
impl StructuralPartialEq for KnownSmartPointer
Auto Trait Implementations§
impl Freeze for KnownSmartPointer
impl RefUnwindSafe for KnownSmartPointer
impl Send for KnownSmartPointer
impl Sync for KnownSmartPointer
impl Unpin for KnownSmartPointer
impl UnwindSafe for KnownSmartPointer
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