pub struct IMMetadata<T: PolarsDataType>(/* private fields */);
Expand description
An interiorally mutable Metadata
This is essentially a more convenient API around RwLock<Metadata>
. This also allows it to be
Clone
.
Implementations§
Source§impl<'a, T: PolarsDataType + 'a> IMMetadata<T>where
Metadata<T>: MetadataTrait + 'a,
impl<'a, T: PolarsDataType + 'a> IMMetadata<T>where
Metadata<T>: MetadataTrait + 'a,
Sourcepub fn upcast(&'a self) -> &'a RwLock<dyn MetadataTrait + 'a>
pub fn upcast(&'a self) -> &'a RwLock<dyn MetadataTrait + 'a>
Cast the IMMetadata
to a trait object of MetadataTrait
Sourcepub fn boxed_upcast(&'a self) -> Box<dyn MetadataTrait + 'a>
pub fn boxed_upcast(&'a self) -> Box<dyn MetadataTrait + 'a>
Cast the IMMetadata
to a boxed trait object of MetadataTrait
Source§impl<T: PolarsDataType> IMMetadata<T>
impl<T: PolarsDataType> IMMetadata<T>
pub const fn new(md: Metadata<T>) -> Self
Sourcepub fn try_read(&self) -> Option<RwLockReadGuard<'_, Metadata<T>>>
pub fn try_read(&self) -> Option<RwLockReadGuard<'_, Metadata<T>>>
Try to grab a read guard to the Metadata
, this fails if this blocks.
Sourcepub fn read(&self) -> RwLockReadGuard<'_, Metadata<T>>
pub fn read(&self) -> RwLockReadGuard<'_, Metadata<T>>
Block to grab a read guard the Metadata
Sourcepub fn try_write(&self) -> Option<RwLockWriteGuard<'_, Metadata<T>>>
pub fn try_write(&self) -> Option<RwLockWriteGuard<'_, Metadata<T>>>
Try to grab a write guard to the Metadata
, this fails if this blocks.
Sourcepub fn write(&self) -> RwLockWriteGuard<'_, Metadata<T>>
pub fn write(&self) -> RwLockWriteGuard<'_, Metadata<T>>
Block to grab a write guard the Metadata
Trait Implementations§
Source§impl<T: PolarsDataType> Clone for IMMetadata<T>
impl<T: PolarsDataType> Clone for IMMetadata<T>
Source§impl<T: PolarsDataType> Default for IMMetadata<T>
impl<T: PolarsDataType> Default for IMMetadata<T>
Auto Trait Implementations§
impl<T> !Freeze for IMMetadata<T>
impl<T> RefUnwindSafe for IMMetadata<T>
impl<T> Send for IMMetadata<T>
impl<T> Sync for IMMetadata<T>
impl<T> Unpin for IMMetadata<T>
impl<T> UnwindSafe for IMMetadata<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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)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