pub enum AnyValue<'a> {
Show 33 variants
Null,
Boolean(bool),
String(&'a str),
UInt8(u8),
UInt16(u16),
UInt32(u32),
UInt64(u64),
Int8(i8),
Int16(i16),
Int32(i32),
Int64(i64),
Int128(i128),
Float32(f32),
Float64(f64),
Date(i32),
Datetime(i64, TimeUnit, Option<&'a PlSmallStr>),
DatetimeOwned(i64, TimeUnit, Option<Arc<PlSmallStr>>),
Duration(i64, TimeUnit),
Time(i64),
Categorical(u32, &'a RevMapping, SyncPtr<BinaryViewArrayGeneric<str>>),
CategoricalOwned(u32, Arc<RevMapping>, SyncPtr<BinaryViewArrayGeneric<str>>),
Enum(u32, &'a RevMapping, SyncPtr<BinaryViewArrayGeneric<str>>),
EnumOwned(u32, Arc<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(PlSmallStr),
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.
Int128(i128)
A 128-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, Option<&'a PlSmallStr>)
dtype-datetime
only.A 64-bit date representing the elapsed time since UNIX epoch (1970-01-01) in nanoseconds (64 bits).
DatetimeOwned(i64, TimeUnit, Option<Arc<PlSmallStr>>)
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.A 64-bit integer representing difference between date-times in TimeUnit
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.CategoricalOwned(u32, Arc<RevMapping>, SyncPtr<BinaryViewArrayGeneric<str>>)
dtype-categorical
only.Enum(u32, &'a RevMapping, SyncPtr<BinaryViewArrayGeneric<str>>)
dtype-categorical
only.EnumOwned(u32, Arc<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(PlSmallStr)
An UTF8 encoded string type.
Binary(&'a [u8])
BinaryOwned(Vec<u8>)
Decimal(i128, usize)
dtype-decimal
only.A 128-bit fixed point decimal number with a scale.
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_nan(&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>
pub fn idx(&self) -> u32
pub fn str_value(&self) -> Cow<'a, str>
Trait Implementations§
Source§impl<'a> Deserialize<'a> for AnyValue<'static>
Available on crate feature serde
only.
impl<'a> Deserialize<'a> for AnyValue<'static>
serde
only.Source§fn deserialize<D>(
deserializer: D,
) -> Result<AnyValue<'static>, <D as Deserializer<'a>>::Error>where
D: Deserializer<'a>,
fn deserialize<D>(
deserializer: D,
) -> Result<AnyValue<'static>, <D as Deserializer<'a>>::Error>where
D: Deserializer<'a>,
Source§impl From<&AnyValue<'_>> for NaiveDateTime
impl From<&AnyValue<'_>> for NaiveDateTime
Source§fn from(v: &AnyValue<'_>) -> NaiveDateTime
fn from(v: &AnyValue<'_>) -> NaiveDateTime
§impl From<AnyValue<'_>> for LiteralValue
impl From<AnyValue<'_>> for LiteralValue
§fn from(value: AnyValue<'_>) -> LiteralValue
fn from(value: AnyValue<'_>) -> LiteralValue
Source§impl<K> From<K> for AnyValue<'static>where
K: NumericNative,
impl<K> From<K> for AnyValue<'static>where
K: NumericNative,
Source§impl PartialOrd for AnyValue<'_>
impl PartialOrd for AnyValue<'_>
Source§impl Serialize for AnyValue<'_>
Available on crate feature serde
only.
impl Serialize for AnyValue<'_>
serde
only.Source§fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
impl Eq for AnyValue<'_>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§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.§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<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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> ⓘ
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§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
ToCompactString::to_compact_string()
] Read more§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
CompactString
]. Read more