Enum polars_core::datatypes::AnyValue
source · pub enum AnyValue<'a> {
Show 22 variants
Null,
Boolean(bool),
String(&'a str),
UInt8(u8),
UInt16(u16),
UInt32(u32),
UInt64(u64),
Int8(i8),
Int16(i16),
Int32(i32),
Int64(i64),
Float32(f32),
Float64(f64),
Categorical(u32, &'a RevMapping, SyncPtr<Utf8ViewArray>),
Enum(u32, &'a RevMapping, SyncPtr<Utf8ViewArray>),
List(Series),
Object(&'a dyn PolarsObjectSafe),
ObjectOwned(OwnedObject),
StringOwned(String),
Binary(&'a [u8]),
BinaryOwned(Vec<u8>),
Decimal(i128, usize),
}
Variants§
Null
Boolean(bool)
A binary true or false.
String(&'a str)
A UTF8 encoded string type.
UInt8(u8)
An unsigned 8-bit integer number.
UInt16(u16)
An unsigned 16-bit integer number.
UInt32(u32)
An unsigned 32-bit integer number.
UInt64(u64)
An unsigned 64-bit integer number.
Int8(i8)
An 8-bit integer number.
Int16(i16)
A 16-bit integer number.
Int32(i32)
A 32-bit integer number.
Int64(i64)
A 64-bit integer number.
Float32(f32)
A 32-bit floating point number.
Float64(f64)
A 64-bit floating point number.
Categorical(u32, &'a RevMapping, SyncPtr<Utf8ViewArray>)
dtype-categorical
only.Enum(u32, &'a RevMapping, SyncPtr<Utf8ViewArray>)
dtype-categorical
only.List(Series)
Nested type, contains arrays that are filled with one of the datatypes.
Object(&'a dyn PolarsObjectSafe)
object
only.Can be used to fmt and implements Any, so can be downcasted to the proper value type.
ObjectOwned(OwnedObject)
object
only.StringOwned(String)
An UTF8 encoded string type.
Binary(&'a [u8])
BinaryOwned(Vec<u8>)
Decimal(i128, usize)
dtype-decimal
only.A 128-bit fixed point decimal number.
Implementations§
source§impl<'a> AnyValue<'a>
impl<'a> AnyValue<'a>
pub fn try_extract<T: NumCast>(&self) -> PolarsResult<T>
pub fn is_boolean(&self) -> bool
pub fn is_numeric(&self) -> bool
pub fn is_float(&self) -> bool
pub fn is_integer(&self) -> bool
pub fn is_signed_integer(&self) -> bool
pub fn is_unsigned_integer(&self) -> bool
pub fn is_null(&self) -> bool
pub fn is_nested_null(&self) -> bool
sourcepub fn strict_cast(&self, dtype: &'a DataType) -> Option<AnyValue<'a>>
pub fn strict_cast(&self, dtype: &'a DataType) -> Option<AnyValue<'a>>
Cast AnyValue
to the provided data type and return a new AnyValue
with type dtype
,
if possible.
sourcepub fn try_strict_cast(&self, dtype: &'a DataType) -> PolarsResult<AnyValue<'a>>
pub fn try_strict_cast(&self, dtype: &'a DataType) -> PolarsResult<AnyValue<'a>>
Cast AnyValue
to the provided data type and return a new AnyValue
with type dtype
,
if possible.
pub fn cast(&self, dtype: &'a DataType) -> AnyValue<'a>
source§impl<'a> AnyValue<'a>
impl<'a> AnyValue<'a>
pub fn add(&self, rhs: &AnyValue<'_>) -> AnyValue<'static>
pub fn as_borrowed(&self) -> AnyValue<'_>
sourcepub fn into_static(self) -> PolarsResult<AnyValue<'static>>
pub fn into_static(self) -> PolarsResult<AnyValue<'static>>
Try to coerce to an AnyValue with static lifetime. This can be done if it does not borrow any values.
Trait Implementations§
source§impl From<&AnyValue<'_>> for NaiveDateTime
Available on crate features temporal
or dtype-datetime
or dtype-date
only.
impl From<&AnyValue<'_>> for NaiveDateTime
temporal
or dtype-datetime
or dtype-date
only.source§impl From<&AnyValue<'_>> for NaiveTime
Available on crate features temporal
or dtype-datetime
or dtype-date
only.
impl From<&AnyValue<'_>> for NaiveTime
temporal
or dtype-datetime
or dtype-date
only.source§impl<K: NumericNative> From<K> for AnyValue<'static>
impl<K: NumericNative> From<K> for AnyValue<'static>
source§impl PartialEq for AnyValue<'_>
impl PartialEq for AnyValue<'_>
source§impl PartialOrd for AnyValue<'_>
impl PartialOrd for AnyValue<'_>
source§fn partial_cmp(&self, other: &Self) -> Option<Ordering>
fn partial_cmp(&self, other: &Self) -> Option<Ordering>
Only implemented for the same types and physical types!
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moreimpl<'a> Eq for AnyValue<'a>
Auto Trait Implementations§
impl<'a> Freeze for AnyValue<'a>
impl<'a> !RefUnwindSafe for AnyValue<'a>
impl<'a> Send for AnyValue<'a>
impl<'a> Sync for AnyValue<'a>
impl<'a> Unpin for AnyValue<'a>
impl<'a> !UnwindSafe for AnyValue<'a>
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
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.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>
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>
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