pub struct TempRef<'a, T>(/* private fields */);Expand description
A temporary reference to a shared owned object. This permits access to the shared object, but
will block any thread trying to release the last OwnedRef. As such, such reference must be
released as soon as possible. In particular, one must not do any blocking operation while
owning such a refeence.
Implementations§
Source§impl<'a, T> TempRef<'a, T>
impl<'a, T> TempRef<'a, T>
Sourcepub fn ptr_eq(this: &Self, other: &Self) -> bool
pub fn ptr_eq(this: &Self, other: &Self) -> bool
Returns true if the two objects point to the same allocation
Sourcepub fn into_static(this: Self) -> TempRef<'static, T>
pub fn into_static(this: Self) -> TempRef<'static, T>
This allows to change the lifetime annotation of a TempRef to static.
As TempRef must be dropped as soon as possible, this provided the way to block the release
of the related OwnedRefs and as such is considered sensitive. Any caller must ensure that
the returned TempRef is not kept around while doing blocking calls.
Trait Implementations§
Source§impl<'a, T> From<&TempRef<'a, T>> for WeakRefKey<T>
impl<'a, T> From<&TempRef<'a, T>> for WeakRefKey<T>
Source§impl<'a, T: Ord> Ord for TempRef<'a, T>
impl<'a, T: Ord> Ord for TempRef<'a, 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<'a, T: PartialOrd> PartialOrd for TempRef<'a, T>
impl<'a, T: PartialOrd> PartialOrd for TempRef<'a, T>
impl<'a, T: Eq> Eq for TempRef<'a, T>
Auto Trait Implementations§
impl<'a, T> Freeze for TempRef<'a, T>
impl<'a, T> RefUnwindSafe for TempRef<'a, T>where
T: RefUnwindSafe,
impl<'a, T> !Send for TempRef<'a, T>
impl<'a, T> !Sync for TempRef<'a, T>
impl<'a, T> Unpin for TempRef<'a, T>
impl<'a, T> UnwindSafe for TempRef<'a, 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