pub struct Scalar { /* private fields */ }Implementations§
source§impl Scalar
impl Scalar
pub fn primitive<T: NativePType + Into<PValue>>( value: T, nullability: Nullability, ) -> Self
pub fn reinterpret_cast(&self, ptype: PType) -> Self
pub fn zero<T: NativePType + Into<PValue>>(nullability: Nullability) -> Self
source§impl Scalar
impl Scalar
pub fn utf8<B>(str: B, nullability: Nullability) -> Selfwhere
B: Into<BufferString>,
pub fn try_utf8<B>(
str: B,
nullability: Nullability,
) -> Result<Self, <B as TryInto<BufferString>>::Error>where
B: TryInto<BufferString>,
source§impl Scalar
impl Scalar
pub fn new(dtype: DType, value: ScalarValue) -> Self
pub fn dtype(&self) -> &DType
pub fn value(&self) -> &ScalarValue
pub fn into_value(self) -> ScalarValue
pub fn is_valid(&self) -> bool
pub fn is_null(&self) -> bool
pub fn null(dtype: DType) -> Self
pub fn cast(&self, dtype: &DType) -> VortexResult<Self>
Trait Implementations§
source§impl PartialOrd for Scalar
impl PartialOrd for Scalar
source§impl<'a> TryFrom<&'a Scalar> for BinaryScalar<'a>
impl<'a> TryFrom<&'a Scalar> for BinaryScalar<'a>
source§impl<'a> TryFrom<&'a Scalar> for BoolScalar<'a>
impl<'a> TryFrom<&'a Scalar> for BoolScalar<'a>
source§impl<'a> TryFrom<&'a Scalar> for Buffer
impl<'a> TryFrom<&'a Scalar> for Buffer
source§type Error = VortexError
type Error = VortexError
The type returned in the event of a conversion error.
source§fn try_from(value: &'a Scalar) -> VortexResult<Self>
fn try_from(value: &'a Scalar) -> VortexResult<Self>
Performs the conversion.
source§impl<'a> TryFrom<&'a Scalar> for BufferString
impl<'a> TryFrom<&'a Scalar> for BufferString
source§type Error = VortexError
type Error = VortexError
The type returned in the event of a conversion error.
source§fn try_from(value: &'a Scalar) -> VortexResult<Self>
fn try_from(value: &'a Scalar) -> VortexResult<Self>
Performs the conversion.
source§impl<'a> TryFrom<&'a Scalar> for ListScalar<'a>
impl<'a> TryFrom<&'a Scalar> for ListScalar<'a>
source§impl<'a> TryFrom<&'a Scalar> for PrimitiveScalar<'a>
impl<'a> TryFrom<&'a Scalar> for PrimitiveScalar<'a>
source§impl<'a> TryFrom<&'a Scalar> for StructScalar<'a>
impl<'a> TryFrom<&'a Scalar> for StructScalar<'a>
source§impl<'a> TryFrom<&'a Scalar> for Utf8Scalar<'a>
impl<'a> TryFrom<&'a Scalar> for Utf8Scalar<'a>
source§impl TryFrom<&Scalar> for bool
impl TryFrom<&Scalar> for bool
source§type Error = VortexError
type Error = VortexError
The type returned in the event of a conversion error.
source§fn try_from(value: &Scalar) -> VortexResult<Self>
fn try_from(value: &Scalar) -> VortexResult<Self>
Performs the conversion.
source§impl TryFrom<&Scalar> for usize
impl TryFrom<&Scalar> for usize
Read a scalar as usize. For usize only, we implicitly cast for better ergonomics.
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)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