pub struct Scalar { /* private fields */ }
Implementations§
Source§impl Scalar
impl Scalar
pub fn new_date(value: i32) -> Scalar
pub fn new_datetime( value: i64, time_unit: TimeUnit, tz: Option<TimeZone>, ) -> Scalar
pub fn new_duration(value: i64, time_unit: TimeUnit) -> Scalar
pub fn new_time(value: i64) -> Scalar
pub fn new_list(values: Series) -> Scalar
pub fn new_array(values: Series, width: usize) -> Scalar
pub fn new_decimal(value: i128, scale: usize) -> Scalar
pub fn new_enum( value: u32, categories: &BinaryViewArrayGeneric<str>, ) -> Result<Scalar, PolarsError>
pub fn new_categorical( value: &str, name: PlSmallStr, namespace: PlSmallStr, physical: CategoricalPhysical, ) -> Result<Scalar, PolarsError>
Source§impl Scalar
impl Scalar
pub const fn new(dtype: DataType, value: AnyValue<'static>) -> Scalar
pub const fn null(dtype: DataType) -> Scalar
pub fn new_idxsize(value: u32) -> Scalar
pub fn cast_with_options( self, dtype: &DataType, options: CastOptions, ) -> Result<Scalar, PolarsError>
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>) -> Scalar
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
impl<'a> Deserialize<'a> for Scalar
Source§fn deserialize<D>(
deserializer: D,
) -> Result<Scalar, <D as Deserializer<'a>>::Error>where
D: Deserializer<'a>,
fn deserialize<D>(
deserializer: D,
) -> Result<Scalar, <D as Deserializer<'a>>::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) -> Scalar
fn from(v: PlSmallStr) -> Scalar
Converts to this type from the input type.
§impl From<Scalar> for LiteralValue
impl From<Scalar> for LiteralValue
§fn from(value: Scalar) -> LiteralValue
fn from(value: Scalar) -> LiteralValue
Converts to this type from the input type.
Source§impl Serialize for Scalar
impl Serialize for Scalar
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,
Serialize this value into the given Serde serializer. 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 !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,
§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> ⓘ
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