Struct polars_arrow::scalar::PrimitiveScalar
source · pub struct PrimitiveScalar<T: NativeType> { /* private fields */ }
Expand description
The implementation of Scalar
for primitive, semantically equivalent to Option<T>
with ArrowDataType
.
Implementations§
source§impl<T: NativeType> PrimitiveScalar<T>
impl<T: NativeType> PrimitiveScalar<T>
sourcepub fn new(data_type: ArrowDataType, value: Option<T>) -> Self
pub fn new(data_type: ArrowDataType, value: Option<T>) -> Self
Returns a new PrimitiveScalar
.
sourcepub fn to(self, data_type: ArrowDataType) -> Self
pub fn to(self, data_type: ArrowDataType) -> Self
Returns a new PrimitiveScalar
with the same value but different ArrowDataType
§Panic
This function panics if the data_type
is not valid for self’s physical type T
.
Trait Implementations§
source§impl<T: Clone + NativeType> Clone for PrimitiveScalar<T>
impl<T: Clone + NativeType> Clone for PrimitiveScalar<T>
source§fn clone(&self) -> PrimitiveScalar<T>
fn clone(&self) -> PrimitiveScalar<T>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<T: Debug + NativeType> Debug for PrimitiveScalar<T>
impl<T: Debug + NativeType> Debug for PrimitiveScalar<T>
source§impl<T: NativeType> From<Option<T>> for PrimitiveScalar<T>
impl<T: NativeType> From<Option<T>> for PrimitiveScalar<T>
source§impl<T: PartialEq + NativeType> PartialEq for PrimitiveScalar<T>
impl<T: PartialEq + NativeType> PartialEq for PrimitiveScalar<T>
source§fn eq(&self, other: &PrimitiveScalar<T>) -> bool
fn eq(&self, other: &PrimitiveScalar<T>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl<T: NativeType> Scalar for PrimitiveScalar<T>
impl<T: NativeType> Scalar for PrimitiveScalar<T>
impl<T: Eq + NativeType> Eq for PrimitiveScalar<T>
impl<T: NativeType> StructuralPartialEq for PrimitiveScalar<T>
Auto Trait Implementations§
impl<T> Freeze for PrimitiveScalar<T>where
T: Freeze,
impl<T> RefUnwindSafe for PrimitiveScalar<T>
impl<T> Send for PrimitiveScalar<T>
impl<T> Sync for PrimitiveScalar<T>
impl<T> Unpin for PrimitiveScalar<T>where
T: Unpin,
impl<T> UnwindSafe for PrimitiveScalar<T>where
T: UnwindSafe,
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§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.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