vortex_scalar

Struct Scalar

source
pub struct Scalar { /* private fields */ }

Implementations§

source§

impl Scalar

source

pub fn binary(buffer: Buffer, nullability: Nullability) -> Self

source§

impl Scalar

source

pub fn bool(value: bool, nullability: Nullability) -> Self

source§

impl Scalar

source

pub fn extension(ext_dtype: ExtDType, storage: Self) -> Self

source§

impl Scalar

source

pub fn list(element_dtype: DType, children: Vec<ScalarValue>) -> Self

source§

impl Scalar

source

pub fn primitive<T: NativePType + Into<PValue>>( value: T, nullability: Nullability, ) -> Self

source

pub fn reinterpret_cast(&self, ptype: PType) -> Self

source

pub fn zero<T: NativePType + Into<PValue>>(nullability: Nullability) -> Self

source§

impl Scalar

source

pub fn struct(dtype: DType, children: Vec<ScalarValue>) -> Self

source§

impl Scalar

source

pub fn utf8<B>(str: B, nullability: Nullability) -> Self
where B: Into<BufferString>,

source

pub fn try_utf8<B>( str: B, nullability: Nullability, ) -> Result<Self, <B as TryInto<BufferString>>::Error>

source§

impl Scalar

source

pub fn new(dtype: DType, value: ScalarValue) -> Self

source

pub fn dtype(&self) -> &DType

source

pub fn value(&self) -> &ScalarValue

source

pub fn into_value(self) -> ScalarValue

source

pub fn is_valid(&self) -> bool

source

pub fn is_null(&self) -> bool

source

pub fn null(dtype: DType) -> Self

source

pub fn cast(&self, dtype: &DType) -> VortexResult<Self>

Trait Implementations§

source§

impl AsRef<Scalar> for Scalar

source§

fn as_ref(&self) -> &Self

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl Clone for Scalar

source§

fn clone(&self) -> Scalar

Returns a copy of the value. Read more
1.6.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Scalar

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for Scalar

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl From<&str> for Scalar

source§

fn from(value: &str) -> Self

Converts to this type from the input type.
source§

impl From<Option<f16>> for Scalar

source§

fn from(value: Option<f16>) -> Self

Converts to this type from the input type.
source§

impl From<Option<f32>> for Scalar

source§

fn from(value: Option<f32>) -> Self

Converts to this type from the input type.
source§

impl From<Option<f64>> for Scalar

source§

fn from(value: Option<f64>) -> Self

Converts to this type from the input type.
source§

impl From<Option<i16>> for Scalar

source§

fn from(value: Option<i16>) -> Self

Converts to this type from the input type.
source§

impl From<Option<i32>> for Scalar

source§

fn from(value: Option<i32>) -> Self

Converts to this type from the input type.
source§

impl From<Option<i64>> for Scalar

source§

fn from(value: Option<i64>) -> Self

Converts to this type from the input type.
source§

impl From<Option<i8>> for Scalar

source§

fn from(value: Option<i8>) -> Self

Converts to this type from the input type.
source§

impl From<Option<u16>> for Scalar

source§

fn from(value: Option<u16>) -> Self

Converts to this type from the input type.
source§

impl From<Option<u32>> for Scalar

source§

fn from(value: Option<u32>) -> Self

Converts to this type from the input type.
source§

impl From<Option<u64>> for Scalar

source§

fn from(value: Option<u64>) -> Self

Converts to this type from the input type.
source§

impl From<Option<u8>> for Scalar

source§

fn from(value: Option<u8>) -> Self

Converts to this type from the input type.
source§

impl<T> From<Vec<T>> for Scalar
where Self: From<T>,

source§

fn from(value: Vec<T>) -> Self

Converts to this type from the input type.
source§

impl From<bool> for Scalar

source§

fn from(value: bool) -> Self

Converts to this type from the input type.
source§

impl From<f16> for Scalar

source§

fn from(value: f16) -> Self

Converts to this type from the input type.
source§

impl From<f32> for Scalar

source§

fn from(value: f32) -> Self

Converts to this type from the input type.
source§

impl From<f64> for Scalar

source§

fn from(value: f64) -> Self

Converts to this type from the input type.
source§

impl From<i16> for Scalar

source§

fn from(value: i16) -> Self

Converts to this type from the input type.
source§

impl From<i32> for Scalar

source§

fn from(value: i32) -> Self

Converts to this type from the input type.
source§

impl From<i64> for Scalar

source§

fn from(value: i64) -> Self

Converts to this type from the input type.
source§

impl From<i8> for Scalar

source§

fn from(value: i8) -> Self

Converts to this type from the input type.
source§

impl From<u16> for Scalar

source§

fn from(value: u16) -> Self

Converts to this type from the input type.
source§

impl From<u32> for Scalar

source§

fn from(value: u32) -> Self

Converts to this type from the input type.
source§

impl From<u64> for Scalar

source§

fn from(value: u64) -> Self

Converts to this type from the input type.
source§

impl From<u8> for Scalar

source§

fn from(value: u8) -> Self

Converts to this type from the input type.
source§

impl From<usize> for Scalar

source§

fn from(value: usize) -> Self

Converts to this type from the input type.
source§

impl PartialEq for Scalar

source§

fn eq(&self, other: &Self) -> bool

Tests for self and other values to be equal, and is used by ==.
1.6.0 · source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for Scalar

source§

fn partial_cmp(&self, other: &Self) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.6.0 · source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.6.0 · source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.6.0 · source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.6.0 · source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl TryFrom<&Scalar> for Arc<dyn Datum>

source§

type Error = VortexError

The type returned in the event of a conversion error.
source§

fn try_from(value: &Scalar) -> Result<Arc<dyn Datum>, Self::Error>

Performs the conversion.
source§

impl<'a> TryFrom<&'a Scalar> for BinaryScalar<'a>

source§

type Error = VortexError

The type returned in the event of a conversion error.
source§

fn try_from(value: &'a Scalar) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl<'a> TryFrom<&'a Scalar> for BoolScalar<'a>

source§

type Error = VortexError

The type returned in the event of a conversion error.
source§

fn try_from(value: &'a Scalar) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl<'a> TryFrom<&'a Scalar> for Buffer

source§

type Error = VortexError

The type returned in the event of a conversion error.
source§

fn try_from(value: &'a Scalar) -> VortexResult<Self>

Performs the conversion.
source§

impl<'a> TryFrom<&'a Scalar> for BufferString

source§

type Error = VortexError

The type returned in the event of a conversion error.
source§

fn try_from(value: &'a Scalar) -> VortexResult<Self>

Performs the conversion.
source§

impl<'a> TryFrom<&'a Scalar> for ExtScalar<'a>

source§

type Error = VortexError

The type returned in the event of a conversion error.
source§

fn try_from(value: &'a Scalar) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl<'a> TryFrom<&'a Scalar> for ListScalar<'a>

source§

type Error = VortexError

The type returned in the event of a conversion error.
source§

fn try_from(value: &'a Scalar) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl<'a> TryFrom<&'a Scalar> for PrimitiveScalar<'a>

source§

type Error = VortexError

The type returned in the event of a conversion error.
source§

fn try_from(value: &'a Scalar) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl<'a> TryFrom<&'a Scalar> for StructScalar<'a>

source§

type Error = VortexError

The type returned in the event of a conversion error.
source§

fn try_from(value: &'a Scalar) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl<'a> TryFrom<&'a Scalar> for Utf8Scalar<'a>

source§

type Error = VortexError

The type returned in the event of a conversion error.
source§

fn try_from(value: &'a Scalar) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl<'a, T: for<'b> TryFrom<&'b Scalar, Error = VortexError>> TryFrom<&'a Scalar> for Vec<T>

source§

type Error = VortexError

The type returned in the event of a conversion error.
source§

fn try_from(value: &'a Scalar) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<&Scalar> for bool

source§

type Error = VortexError

The type returned in the event of a conversion error.
source§

fn try_from(value: &Scalar) -> VortexResult<Self>

Performs the conversion.
source§

impl TryFrom<&Scalar> for f16

source§

type Error = VortexError

The type returned in the event of a conversion error.
source§

fn try_from(value: &Scalar) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<&Scalar> for f32

source§

type Error = VortexError

The type returned in the event of a conversion error.
source§

fn try_from(value: &Scalar) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<&Scalar> for f64

source§

type Error = VortexError

The type returned in the event of a conversion error.
source§

fn try_from(value: &Scalar) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<&Scalar> for i16

source§

type Error = VortexError

The type returned in the event of a conversion error.
source§

fn try_from(value: &Scalar) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<&Scalar> for i32

source§

type Error = VortexError

The type returned in the event of a conversion error.
source§

fn try_from(value: &Scalar) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<&Scalar> for i64

source§

type Error = VortexError

The type returned in the event of a conversion error.
source§

fn try_from(value: &Scalar) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<&Scalar> for i8

source§

type Error = VortexError

The type returned in the event of a conversion error.
source§

fn try_from(value: &Scalar) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<&Scalar> for u16

source§

type Error = VortexError

The type returned in the event of a conversion error.
source§

fn try_from(value: &Scalar) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<&Scalar> for u32

source§

type Error = VortexError

The type returned in the event of a conversion error.
source§

fn try_from(value: &Scalar) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<&Scalar> for u64

source§

type Error = VortexError

The type returned in the event of a conversion error.
source§

fn try_from(value: &Scalar) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<&Scalar> for u8

source§

type Error = VortexError

The type returned in the event of a conversion error.
source§

fn try_from(value: &Scalar) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<&Scalar> for usize

Read a scalar as usize. For usize only, we implicitly cast for better ergonomics.

source§

type Error = VortexError

The type returned in the event of a conversion error.
source§

fn try_from(value: &Scalar) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<Scalar> for f16

source§

type Error = VortexError

The type returned in the event of a conversion error.
source§

fn try_from(value: Scalar) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<Scalar> for f32

source§

type Error = VortexError

The type returned in the event of a conversion error.
source§

fn try_from(value: Scalar) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<Scalar> for f64

source§

type Error = VortexError

The type returned in the event of a conversion error.
source§

fn try_from(value: Scalar) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<Scalar> for i16

source§

type Error = VortexError

The type returned in the event of a conversion error.
source§

fn try_from(value: Scalar) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<Scalar> for i32

source§

type Error = VortexError

The type returned in the event of a conversion error.
source§

fn try_from(value: Scalar) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<Scalar> for i64

source§

type Error = VortexError

The type returned in the event of a conversion error.
source§

fn try_from(value: Scalar) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<Scalar> for i8

source§

type Error = VortexError

The type returned in the event of a conversion error.
source§

fn try_from(value: Scalar) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<Scalar> for u16

source§

type Error = VortexError

The type returned in the event of a conversion error.
source§

fn try_from(value: Scalar) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<Scalar> for u32

source§

type Error = VortexError

The type returned in the event of a conversion error.
source§

fn try_from(value: Scalar) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<Scalar> for u64

source§

type Error = VortexError

The type returned in the event of a conversion error.
source§

fn try_from(value: Scalar) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<Scalar> for u8

source§

type Error = VortexError

The type returned in the event of a conversion error.
source§

fn try_from(value: Scalar) -> Result<Self, Self::Error>

Performs the conversion.

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> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where T: Clone,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
source§

impl<T> ToOwned for T
where T: Clone,

source§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

source§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> Allocation for T
where T: RefUnwindSafe + Send + Sync,