pub struct PrimitiveScalar<'a> { /* private fields */ }Implementations§
Source§impl<'a> PrimitiveScalar<'a>
impl<'a> PrimitiveScalar<'a>
pub fn try_new(dtype: &'a DType, value: &ScalarValue) -> VortexResult<Self>
pub fn dtype(&self) -> &'a DType
pub fn ptype(&self) -> PType
pub fn pvalue(&self) -> Option<PValue>
pub fn typed_value<T: NativePType + TryFrom<PValue, Error = VortexError>>( &self, ) -> Option<T>
Sourcepub fn as_<T: FromPrimitiveOrF16>(&self) -> VortexResult<Option<T>>
pub fn as_<T: FromPrimitiveOrF16>(&self) -> VortexResult<Option<T>>
Attempt to extract the primitive value as the given type. Fails on a bad cast.
Source§impl<'a> PrimitiveScalar<'a>
impl<'a> PrimitiveScalar<'a>
Sourcepub fn checked_binary_numeric(
&self,
other: &PrimitiveScalar<'a>,
op: BinaryNumericOperator,
) -> Option<PrimitiveScalar<'a>>
pub fn checked_binary_numeric( &self, other: &PrimitiveScalar<'a>, op: BinaryNumericOperator, ) -> Option<PrimitiveScalar<'a>>
Apply the (checked) operator to self and other using SQL-style null semantics.
If the operation overflows, Ok(None) is returned.
If the types are incompatible (ignoring nullability), an error is returned.
If either value is null, the result is null.
Trait Implementations§
Source§impl Add for PrimitiveScalar<'_>
impl Add for PrimitiveScalar<'_>
Source§impl CheckedAdd for PrimitiveScalar<'_>
impl CheckedAdd for PrimitiveScalar<'_>
Source§fn checked_add(&self, rhs: &Self) -> Option<Self>
fn checked_add(&self, rhs: &Self) -> Option<Self>
Adds two numbers, checking for overflow. If overflow happens,
None is
returned.Source§impl CheckedSub for PrimitiveScalar<'_>
impl CheckedSub for PrimitiveScalar<'_>
Source§fn checked_sub(&self, rhs: &Self) -> Option<Self>
fn checked_sub(&self, rhs: &Self) -> Option<Self>
Subtracts two numbers, checking for underflow. If underflow happens,
None is returned.Source§impl<'a> Clone for PrimitiveScalar<'a>
impl<'a> Clone for PrimitiveScalar<'a>
Source§fn clone(&self) -> PrimitiveScalar<'a>
fn clone(&self) -> PrimitiveScalar<'a>
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<'a> Debug for PrimitiveScalar<'a>
impl<'a> Debug for PrimitiveScalar<'a>
Source§impl Display for PrimitiveScalar<'_>
impl Display for PrimitiveScalar<'_>
Source§impl From<PrimitiveScalar<'_>> for Scalar
impl From<PrimitiveScalar<'_>> for Scalar
Source§fn from(pscalar: PrimitiveScalar<'_>) -> Self
fn from(pscalar: PrimitiveScalar<'_>) -> Self
Converts to this type from the input type.
Source§impl<'a> Hash for PrimitiveScalar<'a>
impl<'a> Hash for PrimitiveScalar<'a>
Source§impl PartialEq for PrimitiveScalar<'_>
impl PartialEq for PrimitiveScalar<'_>
Source§impl PartialOrd for PrimitiveScalar<'_>
Ord is not implemented since it’s undefined for different PTypes
impl PartialOrd for PrimitiveScalar<'_>
Ord is not implemented since it’s undefined for different PTypes
Source§impl Sub for PrimitiveScalar<'_>
impl Sub for PrimitiveScalar<'_>
Source§impl<'a> TryFrom<&'a Scalar> for PrimitiveScalar<'a>
impl<'a> TryFrom<&'a Scalar> for PrimitiveScalar<'a>
impl<'a> Copy for PrimitiveScalar<'a>
impl Eq for PrimitiveScalar<'_>
Auto Trait Implementations§
impl<'a> Freeze for PrimitiveScalar<'a>
impl<'a> RefUnwindSafe for PrimitiveScalar<'a>
impl<'a> Send for PrimitiveScalar<'a>
impl<'a> Sync for PrimitiveScalar<'a>
impl<'a> Unpin for PrimitiveScalar<'a>
impl<'a> UnwindSafe for PrimitiveScalar<'a>
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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 moreSource§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Returns the layout of the type.
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Returns whether the given value has been niched. Read more
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
Writes data to
out indicating that a T is niched.