Struct koto_memory::Ptr
source · pub struct Ptr<T: ?Sized>(/* private fields */);
Expand description
An immutable pointer to a value in allocated memory
Implementations§
source§impl<T: ?Sized> Ptr<T>
impl<T: ?Sized> Ptr<T>
source§impl<T: Clone> Ptr<T>
impl<T: Clone> Ptr<T>
sourcepub fn make_mut(this: &mut Self) -> &mut T
pub fn make_mut(this: &mut Self) -> &mut T
Makes a mutable reference into the owned T
If the pointer has the only reference to the value, then the reference will be returned. Otherwise a clone of the value will be made to ensure uniqueness before returning the reference.
See also: std::sync::Arc::make_mut
Trait Implementations§
source§impl<T: ?Sized + Ord> Ord for Ptr<T>
impl<T: ?Sized + Ord> Ord for Ptr<T>
source§impl<T: ?Sized + PartialEq> PartialEq for Ptr<T>
impl<T: ?Sized + PartialEq> PartialEq for Ptr<T>
source§impl<T: ?Sized + PartialOrd> PartialOrd for Ptr<T>
impl<T: ?Sized + PartialOrd> PartialOrd for Ptr<T>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl<T: ?Sized + Eq> Eq for Ptr<T>
Auto Trait Implementations§
impl<T> Freeze for Ptr<T>where
T: ?Sized,
impl<T> RefUnwindSafe for Ptr<T>where
T: RefUnwindSafe + ?Sized,
impl<T> Send for Ptr<T>
impl<T> Sync for Ptr<T>
impl<T> Unpin for Ptr<T>where
T: ?Sized,
impl<T> UnwindSafe for Ptr<T>where
T: RefUnwindSafe + ?Sized,
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