pub enum Scalar {
Null(NullKind),
Bool(bool),
Int64(i64),
Float64(f64),
Utf8(String),
Timedelta64(i64),
Datetime64(i64),
Period(i64),
Interval(Interval),
}Variants§
Null(NullKind)
Bool(bool)
Int64(i64)
Float64(f64)
Utf8(String)
Timedelta64(i64)
Datetime64(i64)
Nanoseconds since Unix epoch. Matches pandas datetime64[ns].
Uses Timestamp::NAT (i64::MIN) for missing values.
Period(i64)
Period ordinal. Uses i64::MIN for NaT (missing value).
Interval(Interval)
Numeric interval value. Missing values remain Scalar::Null.
Implementations§
Source§impl Scalar
impl Scalar
pub fn dtype(&self) -> DType
pub fn is_missing(&self) -> bool
pub fn is_nan(&self) -> bool
Sourcepub const fn is_integer(&self) -> bool
pub const fn is_integer(&self) -> bool
Returns true if this is an Int64 scalar.
Sourcepub const fn is_numeric(&self) -> bool
pub const fn is_numeric(&self) -> bool
Returns true if this is a numeric scalar (Int64 or Float64).
Sourcepub const fn is_datetime(&self) -> bool
pub const fn is_datetime(&self) -> bool
Returns true if this is a Datetime64 scalar.
Sourcepub const fn is_timedelta(&self) -> bool
pub const fn is_timedelta(&self) -> bool
Returns true if this is a Timedelta64 scalar.
Sourcepub const fn is_interval(&self) -> bool
pub const fn is_interval(&self) -> bool
Returns true if this is an Interval scalar.
pub fn missing_for_dtype(dtype: DType) -> Self
pub fn semantic_eq(&self, other: &Self) -> bool
pub fn semantic_le(&self, other: &Self) -> bool
pub fn semantic_ge(&self, other: &Self) -> bool
pub fn is_null(&self) -> bool
pub fn is_na(&self) -> bool
pub fn coalesce(&self, other: &Self) -> Self
pub fn semantic_cmp(&self, other: &Self) -> Ordering
pub fn to_f64(&self) -> Result<f64, TypeError>
Sourcepub fn to_i64(&self) -> Result<i64, TypeError>
pub fn to_i64(&self) -> Result<i64, TypeError>
Try to convert to i64. Returns error for missing or non-numeric values.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Scalar
impl<'de> Deserialize<'de> for Scalar
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for Scalar
Auto Trait Implementations§
impl Freeze for Scalar
impl RefUnwindSafe for Scalar
impl Send for Scalar
impl Sync for Scalar
impl Unpin for Scalar
impl UnsafeUnpin for Scalar
impl UnwindSafe for Scalar
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