pub struct Scalar { /* private fields */ }
Implementations§
Source§impl Scalar
impl Scalar
pub fn new_list(values: Series) -> Self
pub fn new_array(values: Series, width: usize) -> Self
Available on crate feature
dtype-array
only.pub fn new_decimal(value: i128, scale: usize) -> Self
Available on crate feature
dtype-decimal
only.pub fn new_enum( value: CatSize, categories: &Utf8ViewArray, ) -> PolarsResult<Self>
Available on crate feature
dtype-categorical
only.pub fn new_categorical( value: &str, name: PlSmallStr, namespace: PlSmallStr, physical: CategoricalPhysical, ) -> PolarsResult<Self>
Available on crate feature
dtype-categorical
only.Source§impl Scalar
impl Scalar
pub const fn new(dtype: DataType, value: AnyValue<'static>) -> Self
pub const fn null(dtype: DataType) -> Self
pub fn new_idxsize(value: IdxSize) -> Self
pub fn cast_with_options( self, dtype: &DataType, options: CastOptions, ) -> PolarsResult<Self>
pub fn is_null(&self) -> bool
pub fn is_nan(&self) -> bool
pub fn into_value(self) -> AnyValue<'static>
pub fn value(&self) -> &AnyValue<'static>
pub fn as_any_value(&self) -> AnyValue<'_>
pub fn into_series(self, name: PlSmallStr) -> Series
Sourcepub fn into_column(self, name: PlSmallStr) -> Column
pub fn into_column(self, name: PlSmallStr) -> Column
Turn a scalar into a column with length=1
.
pub fn dtype(&self) -> &DataType
pub fn update(&mut self, value: AnyValue<'static>)
pub fn with_value(self, value: AnyValue<'static>) -> Self
pub fn any_value_mut(&mut self) -> &mut AnyValue<'static>
pub fn to_physical(self) -> Scalar
Trait Implementations§
Source§impl<'a> Deserialize<'a> for Scalar
Available on (crate features serde
or dsl-schema
) and crate feature serde
only.
impl<'a> Deserialize<'a> for Scalar
Available on (crate features
serde
or dsl-schema
) and crate feature serde
only.Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'a>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'a>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<PlSmallStr> for Scalar
impl From<PlSmallStr> for Scalar
Source§fn from(v: PlSmallStr) -> Self
fn from(v: PlSmallStr) -> Self
Converts to this type from the input type.
Source§impl Serialize for Scalar
Available on (crate features serde
or dsl-schema
) and crate feature serde
only.
impl Serialize for Scalar
Available on (crate features
serde
or dsl-schema
) and crate feature serde
only.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 !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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
Converts
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>
Converts
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