Enum polars_core::datatypes::AnyValue
source · pub enum AnyValue<'a> {
Show 26 variants
Null,
Boolean(bool),
Utf8(&'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<TimeZone>),
Duration(i64, TimeUnit),
Time(i64),
Categorical(u32, &'a RevMapping, SyncPtr<Utf8Array<i64>>),
List(Series),
Object(&'a dyn PolarsObjectSafe),
ObjectOwned(OwnedObject),
Struct(usize, &'a StructArray, &'a [Field]),
StructOwned(Box<(Vec<AnyValue<'a>>, Vec<Field>)>),
Utf8Owned(String),
Binary(&'a [u8]),
BinaryOwned(Vec<u8>),
}
Variants§
Null
Boolean(bool)
A binary true or false.
Utf8(&'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<TimeZone>)
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<Utf8Array<i64>>)
dtype-categorical
only.List(Series)
Nested type, contains arrays that are filled with one of the datetypes.
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.Struct(usize, &'a StructArray, &'a [Field])
dtype-struct
only.StructOwned(Box<(Vec<AnyValue<'a>>, Vec<Field>)>)
dtype-struct
only.Utf8Owned(String)
An UTF8 encoded string type.
Binary(&'a [u8])
dtype-binary
only.BinaryOwned(Vec<u8>)
dtype-binary
only.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 dtype(&self) -> DataType
pub fn try_extract<T: NumCast>(&self) -> PolarsResult<T>
source§impl<'a> AnyValue<'a>
impl<'a> AnyValue<'a>
pub fn add(&self, rhs: &AnyValue<'_>) -> Self
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<'_>
impl<K: NumericNative> From<K> for AnyValue<'_>
source§impl PartialEq<AnyValue<'_>> for AnyValue<'_>
impl PartialEq<AnyValue<'_>> for AnyValue<'_>
source§impl PartialOrd<AnyValue<'_>> for AnyValue<'_>
impl PartialOrd<AnyValue<'_>> 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> !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<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.