pub struct TypeDataRef<'a, T: 'static> { /* private fields */ }Expand description
Read guard for type data access, using mapped guard for zero-cost deref.
Implementations§
Source§impl<'a, T: Any + 'static> TypeDataRef<'a, T>
impl<'a, T: Any + 'static> TypeDataRef<'a, T>
Sourcepub fn try_new(
guard: PyRwLockReadGuard<'a, Option<TypeDataSlot>>,
) -> Option<Self>
pub fn try_new( guard: PyRwLockReadGuard<'a, Option<TypeDataSlot>>, ) -> Option<Self>
Try to create a TypeDataRef from a read guard. Returns None if the slot is empty or contains a different type.
Trait Implementations§
Auto Trait Implementations§
impl<'a, T> Freeze for TypeDataRef<'a, T>
impl<'a, T> !RefUnwindSafe for TypeDataRef<'a, T>
impl<'a, T> !Send for TypeDataRef<'a, T>
impl<'a, T> Sync for TypeDataRef<'a, T>where
T: Sync,
impl<'a, T> Unpin for TypeDataRef<'a, T>
impl<'a, T> UnsafeUnpin for TypeDataRef<'a, T>
impl<'a, T> !UnwindSafe for TypeDataRef<'a, T>
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<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