pub struct FrozenCategories { /* private fields */ }
Expand description
An ordered collection of unique strings with an associated pre-computed mapping to go from string <-> index.
FrozenCategories are globally unique to facilitate constant-time comparison.
Implementations§
Source§impl FrozenCategories
impl FrozenCategories
Sourcepub fn new<'a, I>(
physical: CategoricalPhysical,
strings: I,
) -> Result<Arc<FrozenCategories>, PolarsError>
pub fn new<'a, I>( physical: CategoricalPhysical, strings: I, ) -> Result<Arc<FrozenCategories>, PolarsError>
Creates a new FrozenCategories object (or returns a reference to an existing one in case these are already known). Returns an error if the categories are not unique. It is guaranteed that the nth string ends up with category n (0-indexed).
Sourcepub fn mapping(&self) -> &Arc<CategoricalMapping>
pub fn mapping(&self) -> &Arc<CategoricalMapping>
The mapping for this FrozenCategories object.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for FrozenCategories
impl RefUnwindSafe for FrozenCategories
impl Send for FrozenCategories
impl Sync for FrozenCategories
impl Unpin for FrozenCategories
impl UnwindSafe for FrozenCategories
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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