pub enum AnyValue<'a> {
Show 29 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),
    Date(i32),
    Datetime(i64, TimeUnit, &'a Option<String>),
    Duration(i64, TimeUnit),
    Time(i64),
    Categorical(u32, &'a RevMapping, SyncPtr<BinaryViewArrayGeneric<str>>),
    Enum(u32, &'a RevMapping, SyncPtr<BinaryViewArrayGeneric<str>>),
    List(Series),
    Array(Series, usize),
    Object(&'a (dyn PolarsObjectSafe + 'static)),
    ObjectOwned(OwnedObject),
    Struct(usize, &'a StructArray, &'a [Field]),
    StructOwned(Box<(Vec<AnyValue<'a>>, Vec<Field>)>),
    StringOwned(SmartString<LazyCompact>),
    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.
Date(i32)
dtype-date only.A 32-bit date representing the elapsed time since UNIX epoch (1970-01-01) in days (32 bits).
Datetime(i64, TimeUnit, &'a Option<String>)
dtype-datetime only.A 64-bit date representing the elapsed time since UNIX epoch (1970-01-01) in nanoseconds (64 bits).
Duration(i64, TimeUnit)
dtype-duration only.Time(i64)
dtype-time only.A 64-bit time representing the elapsed time since midnight in nanoseconds
Categorical(u32, &'a RevMapping, SyncPtr<BinaryViewArrayGeneric<str>>)
dtype-categorical only.Enum(u32, &'a RevMapping, SyncPtr<BinaryViewArrayGeneric<str>>)
dtype-categorical only.List(Series)
Nested type, contains arrays that are filled with one of the datatypes.
Array(Series, usize)
dtype-array only.Object(&'a (dyn PolarsObjectSafe + 'static))
object only.Can be used to fmt and implements Any, so can be downcasted to the proper value type.
ObjectOwned(OwnedObject)
object only.Struct(usize, &'a StructArray, &'a [Field])
dtype-struct only.StructOwned(Box<(Vec<AnyValue<'a>>, Vec<Field>)>)
dtype-struct only.StringOwned(SmartString<LazyCompact>)
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 _iter_struct_av(&self) -> impl Iterator<Item = AnyValue<'_>>
dtype-struct only.pub fn _materialize_struct_av(&'a self, buf: &mut Vec<AnyValue<'a>>)
dtype-struct only.source§impl<'a> AnyValue<'a>
 
impl<'a> AnyValue<'a>
pub fn try_extract<T>(&self) -> Result<T, PolarsError>where
    T: NumCast,
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
) -> Result<AnyValue<'a>, PolarsError>
 
pub fn try_strict_cast( &self, dtype: &'a DataType ) -> Result<AnyValue<'a>, PolarsError>
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) -> Result<AnyValue<'static>, PolarsError>
 
pub fn into_static(self) -> Result<AnyValue<'static>, PolarsError>
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
 
impl From<&AnyValue<'_>> for NaiveDateTime
source§fn from(v: &AnyValue<'_>) -> NaiveDateTime
 
fn from(v: &AnyValue<'_>) -> NaiveDateTime
source§impl<K> From<K> for AnyValue<'static>where
    K: NumericNative,
 
impl<K> From<K> for AnyValue<'static>where
    K: NumericNative,
source§impl PartialEq for AnyValue<'_>
 
impl PartialEq for AnyValue<'_>
source§impl PartialOrd for AnyValue<'_>
 
impl PartialOrd for AnyValue<'_>
source§fn partial_cmp(&self, other: &AnyValue<'_>) -> Option<Ordering>
 
fn partial_cmp(&self, other: &AnyValue<'_>) -> 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 more§impl TryFrom<AnyValue<'_>> for LiteralValue
 
impl TryFrom<AnyValue<'_>> for LiteralValue
§type Error = PolarsError
 
type Error = PolarsError
§fn try_from(value: AnyValue<'_>) -> Result<LiteralValue, PolarsError>
 
fn try_from(value: AnyValue<'_>) -> Result<LiteralValue, PolarsError>
impl<'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