pub enum BorrowedValue<'a, T: ?Sized> {
Ref(&'a T),
MuLock(PyMutexGuard<'a, T>),
MappedMuLock(PyImmutableMappedMutexGuard<'a, T>),
ReadLock(PyRwLockReadGuard<'a, T>),
MappedReadLock(PyMappedRwLockReadGuard<'a, T>),
MappedDetachingReadLock(PyMappedDetachingRwLockReadGuard<'a, T>),
}Variants§
Ref(&'a T)
MuLock(PyMutexGuard<'a, T>)
MappedMuLock(PyImmutableMappedMutexGuard<'a, T>)
ReadLock(PyRwLockReadGuard<'a, T>)
MappedReadLock(PyMappedRwLockReadGuard<'a, T>)
MappedDetachingReadLock(PyMappedDetachingRwLockReadGuard<'a, T>)
Implementations§
Source§impl<'a, T: ?Sized> BorrowedValue<'a, T>
impl<'a, T: ?Sized> BorrowedValue<'a, T>
Sourcepub const fn is_locked(&self) -> bool
pub const fn is_locked(&self) -> bool
Whether reaching the value holds a lock that other threads wait on.
An immutable object hands out a plain reference and answers false;
one whose storage can change hands out a guard. A caller about to wait
for something unrelated – a peer, a file, a signal – can use this to
decide whether it may keep the borrow for the duration.
pub fn map<U: ?Sized, F>(s: Self, f: F) -> BorrowedValue<'a, U>
Trait Implementations§
Source§impl<T: ?Sized> Deref for BorrowedValue<'_, T>
impl<T: ?Sized> Deref for BorrowedValue<'_, T>
Source§impl Display for BorrowedValue<'_, str>
impl Display for BorrowedValue<'_, str>
Source§impl<'a, T: ?Sized> From<ImmutableMappedMutexGuard<'a, RawCellMutex, T>> for BorrowedValue<'a, T>
impl<'a, T: ?Sized> From<ImmutableMappedMutexGuard<'a, RawCellMutex, T>> for BorrowedValue<'a, T>
Source§fn from(t: PyImmutableMappedMutexGuard<'a, T>) -> Self
fn from(t: PyImmutableMappedMutexGuard<'a, T>) -> Self
Converts to this type from the input type.
Source§impl<'a, T: ?Sized> From<MappedRwLockReadGuard<'a, RawCellRwLock, T>> for BorrowedValue<'a, T>
impl<'a, T: ?Sized> From<MappedRwLockReadGuard<'a, RawCellRwLock, T>> for BorrowedValue<'a, T>
Source§fn from(t: PyMappedRwLockReadGuard<'a, T>) -> Self
fn from(t: PyMappedRwLockReadGuard<'a, T>) -> Self
Converts to this type from the input type.
Source§impl<'a, T: ?Sized> From<MappedRwLockReadGuard<'a, RawDetachingRwLock, T>> for BorrowedValue<'a, T>
impl<'a, T: ?Sized> From<MappedRwLockReadGuard<'a, RawDetachingRwLock, T>> for BorrowedValue<'a, T>
Source§fn from(t: PyMappedDetachingRwLockReadGuard<'a, T>) -> Self
fn from(t: PyMappedDetachingRwLockReadGuard<'a, T>) -> Self
Converts to this type from the input type.
Source§impl<'a, T: ?Sized> From<MutexGuard<'a, RawCellMutex, T>> for BorrowedValue<'a, T>
impl<'a, T: ?Sized> From<MutexGuard<'a, RawCellMutex, T>> for BorrowedValue<'a, T>
Source§fn from(t: PyMutexGuard<'a, T>) -> Self
fn from(t: PyMutexGuard<'a, T>) -> Self
Converts to this type from the input type.
Source§impl<'a, T: ?Sized> From<RwLockReadGuard<'a, RawCellRwLock, T>> for BorrowedValue<'a, T>
impl<'a, T: ?Sized> From<RwLockReadGuard<'a, RawCellRwLock, T>> for BorrowedValue<'a, T>
Source§fn from(t: PyRwLockReadGuard<'a, T>) -> Self
fn from(t: PyRwLockReadGuard<'a, T>) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl<'a, T> !RefUnwindSafe for BorrowedValue<'a, T>
impl<'a, T> !Send for BorrowedValue<'a, T>
impl<'a, T> !Sync for BorrowedValue<'a, T>
impl<'a, T> !UnwindSafe for BorrowedValue<'a, T>
impl<'a, T> Freeze for BorrowedValue<'a, T>where
&'a T: Freeze,
MutexGuard<'a, RawCellMutex, T>: Freeze,
ImmutableMappedMutexGuard<'a, RawCellMutex, T>: Freeze,
RwLockReadGuard<'a, RawCellRwLock, T>: Freeze,
MappedRwLockReadGuard<'a, RawCellRwLock, T>: Freeze,
MappedRwLockReadGuard<'a, RawDetachingRwLock, T>: Freeze,
T: ?Sized,
impl<'a, T> Unpin for BorrowedValue<'a, T>where
&'a T: Unpin,
MutexGuard<'a, RawCellMutex, T>: Unpin,
ImmutableMappedMutexGuard<'a, RawCellMutex, T>: Unpin,
RwLockReadGuard<'a, RawCellRwLock, T>: Unpin,
MappedRwLockReadGuard<'a, RawCellRwLock, T>: Unpin,
MappedRwLockReadGuard<'a, RawDetachingRwLock, T>: Unpin,
T: ?Sized,
impl<'a, T> UnsafeUnpin for BorrowedValue<'a, T>where
&'a T: UnsafeUnpin,
MutexGuard<'a, RawCellMutex, T>: UnsafeUnpin,
ImmutableMappedMutexGuard<'a, RawCellMutex, T>: UnsafeUnpin,
RwLockReadGuard<'a, RawCellRwLock, T>: UnsafeUnpin,
MappedRwLockReadGuard<'a, RawCellRwLock, T>: UnsafeUnpin,
MappedRwLockReadGuard<'a, RawDetachingRwLock, T>: UnsafeUnpin,
T: ?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
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T, U> ImaginaryInto<U> for Twhere
U: ImaginaryFrom<T>,
impl<T, U> ImaginaryInto<U> for Twhere
U: ImaginaryFrom<T>,
fn imaginary_into(self) -> U
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