pub struct OwnedRef<T> { /* private fields */ }Expand description
An owning reference to a shared owned object. Each instance must call release before being
dropped.
OwnedRef will panic on Drop in debug builds if it has not been released.
Implementations§
Source§impl<T> OwnedRef<T>
impl<T> OwnedRef<T>
Source§impl<T: Releasable> OwnedRef<T>
impl<T: Releasable> OwnedRef<T>
Sourcepub fn take(this: &mut Self) -> Option<ReleaseGuard<T>>
pub fn take(this: &mut Self) -> Option<ReleaseGuard<T>>
Take the releasable from the OwnedRef. Returns None if the OwnedRef is not the last
reference to the data.
Trait Implementations§
Source§impl<'a, T> From<&OwnedRef<T>> for WeakRefKey<T>
impl<'a, T> From<&OwnedRef<T>> for WeakRefKey<T>
Source§impl<T: Ord> Ord for OwnedRef<T>
impl<T: Ord> Ord for OwnedRef<T>
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl<T: PartialOrd> PartialOrd for OwnedRef<T>
impl<T: PartialOrd> PartialOrd for OwnedRef<T>
Source§impl<T: Releasable> Releasable for OwnedRef<T>
impl<T: Releasable> Releasable for OwnedRef<T>
Clone the OwnedRef. Both the current and the new reference needs to be released.
impl<T: Eq> Eq for OwnedRef<T>
Auto Trait Implementations§
impl<T> !Freeze for OwnedRef<T>
impl<T> RefUnwindSafe for OwnedRef<T>where
T: RefUnwindSafe,
impl<T> Send for OwnedRef<T>
impl<T> Sync for OwnedRef<T>
impl<T> Unpin for OwnedRef<T>
impl<T> UnwindSafe for OwnedRef<T>where
T: RefUnwindSafe,
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
§impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
§impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
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.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more