Struct polars_core::chunked_array::metadata::IMMetadata
source · 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
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