Struct koto_runtime::Ptr
source · pub struct Ptr<T>(/* private fields */)
where
T: ?Sized;
Expand description
An immutable pointer to a value in allocated memory
Implementations§
source§impl<T> Ptr<T>where
T: ?Sized,
impl<T> Ptr<T>where
T: ?Sized,
source§impl<T> Ptr<T>where
T: Clone,
impl<T> Ptr<T>where
T: Clone,
sourcepub fn make_mut(this: &mut Ptr<T>) -> &mut T
pub fn make_mut(this: &mut Ptr<T>) -> &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> Ord for Ptr<T>
impl<T> Ord for Ptr<T>
source§impl<T> PartialEq for Ptr<T>
impl<T> PartialEq for Ptr<T>
source§impl<T> PartialOrd for Ptr<T>where
T: PartialOrd + ?Sized,
impl<T> PartialOrd for Ptr<T>where
T: PartialOrd + ?Sized,
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> 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
source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.