Skip to main content

AnyValue

Enum AnyValue 

Source
pub enum AnyValue<'a> {
Show 21 variants Null, Bool(bool), UInt8(u8), UInt16(u16), UInt32(u32), UInt64(u64), UInt128(u128), Int8(i8), Int16(i16), Int32(i32), Int64(i64), Int128(i128), Float32(f32), Float64(f64), Duration(Duration), Char(char), Str(&'a str), StrOwned(String), Slice(&'a [AnyValue<'a>]), Vector(Vec<AnyValue<'a>>), Struct(Vec<(Field, AnyValue<'a>)>),
}

Variants§

§

Null

§

Bool(bool)

§

UInt8(u8)

§

UInt16(u16)

§

UInt32(u32)

§

UInt64(u64)

§

UInt128(u128)

§

Int8(i8)

§

Int16(i16)

§

Int32(i32)

§

Int64(i64)

§

Int128(i128)

§

Float32(f32)

§

Float64(f64)

§

Duration(Duration)

§

Char(char)

§

Str(&'a str)

§

StrOwned(String)

§

Slice(&'a [AnyValue<'a>])

§

Vector(Vec<AnyValue<'a>>)

§

Struct(Vec<(Field, AnyValue<'a>)>)

Implementations§

Source§

impl<'a> AnyValue<'a>

Source

pub fn is_null(&self) -> bool

Source

pub fn is_boolean(&self) -> bool

Source

pub fn is_float(&self) -> bool

Source

pub fn is_int(&self) -> bool

Source

pub fn is_string(&self) -> bool

Source

pub fn is_nested(&self) -> bool

Source

pub fn len(&self) -> Option<usize>

Source

pub fn is_numeric(&self) -> bool

Source

pub fn type_name(&self) -> &'static str

Source

pub fn dtype(&self) -> DataType

Source

pub fn cast(self, to: &DataType) -> Option<AnyValue<'a>>

Source

pub fn into_static(self) -> AnyValue<'static>

Try to coerce to an AnyValue with static lifetime. This can be done if it does not borrow any values.

Source

pub fn extract<T: NumCast>(&self) -> Option<T>

Source

pub fn into_string(self) -> Option<String>

Source

pub fn as_str(&self) -> Option<&str>

Source§

impl<'a> AnyValue<'a>

Source

pub fn get_index(&self, index: usize) -> Option<AnyValue<'a>>

Source

pub fn get_key(&self, key: &AnyValue<'a>) -> Option<AnyValue<'a>>

Source

pub fn get_field(&self, field: &Field) -> Option<AnyValue<'a>>

Trait Implementations§

Source§

impl Add for AnyValue<'_>

Source§

type Output = AnyValue<'_>

The resulting type after applying the + operator.
Source§

fn add(self, other: Self) -> Self

Performs the + operation. Read more
Source§

impl<'a> BitAnd for AnyValue<'a>

Source§

type Output = AnyValue<'static>

The resulting type after applying the & operator.
Source§

fn bitand(self, rhs: Self) -> Self::Output

Performs the & operation. Read more
Source§

impl<'a> BitOr for AnyValue<'a>

Source§

type Output = AnyValue<'static>

The resulting type after applying the | operator.
Source§

fn bitor(self, rhs: Self) -> Self::Output

Performs the | operation. Read more
Source§

impl<'a> Clone for AnyValue<'a>

Source§

fn clone(&self) -> AnyValue<'a>

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl<'a> Debug for AnyValue<'a>

Source§

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

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

impl<'a> Default for AnyValue<'a>

Source§

fn default() -> AnyValue<'a>

Returns the “default value” for a type. Read more
Source§

impl Div for AnyValue<'_>

Source§

type Output = AnyValue<'_>

The resulting type after applying the / operator.
Source§

fn div(self, other: Self) -> Self

Performs the / operation. Read more
Source§

impl<'a> ExprProjection for AnyValue<'a>

Source§

fn project(&self, selector: &SelectExpr) -> Option<AnyValue<'static>>

Source§

impl<'a> From<&'a str> for AnyValue<'a>

Source§

fn from(s: &'a str) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<Duration> for AnyValue<'a>

Source§

fn from(d: Duration) -> Self

Converts to this type from the input type.
Source§

impl<T, K> From<HashMap<T, K>> for AnyValue<'_>
where T: Into<String> + Clone, K: Into<AnyValue<'static>> + Clone,

Source§

fn from(map: HashMap<T, K>) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<String> for AnyValue<'a>

Source§

fn from(s: String) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<Vec<AnyValue<'a>>> for AnyValue<'a>

Source§

fn from(v: Vec<AnyValue<'a>>) -> Self

Converts to this type from the input type.
Source§

impl From<bool> for AnyValue<'_>

Source§

fn from(b: bool) -> Self

Converts to this type from the input type.
Source§

impl From<char> for AnyValue<'_>

Source§

fn from(c: char) -> Self

Converts to this type from the input type.
Source§

impl From<f32> for AnyValue<'_>

Source§

fn from(f: f32) -> Self

Converts to this type from the input type.
Source§

impl From<f64> for AnyValue<'_>

Source§

fn from(f: f64) -> Self

Converts to this type from the input type.
Source§

impl From<i32> for AnyValue<'_>

Source§

fn from(i: i32) -> Self

Converts to this type from the input type.
Source§

impl<'a> Hash for AnyValue<'a>

Source§

fn hash<H: Hasher>(&self, state: &mut H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl Mul for AnyValue<'_>

Source§

type Output = AnyValue<'_>

The resulting type after applying the * operator.
Source§

fn mul(self, other: Self) -> Self

Performs the * operation. Read more
Source§

impl<'a> Not for AnyValue<'a>

Source§

type Output = AnyValue<'static>

The resulting type after applying the ! operator.
Source§

fn not(self) -> Self::Output

Performs the unary ! operation. Read more
Source§

impl<'a> Ord for AnyValue<'a>

Source§

fn cmp(&self, other: &Self) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

impl<'a> PartialEq for AnyValue<'a>

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.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<'a> PartialOrd for AnyValue<'a>

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.0.0 · Source§

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

Tests less than (for self and other) and is used by the < operator. Read more
1.0.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.0.0 · Source§

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

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.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 Rem for AnyValue<'_>

Source§

type Output = AnyValue<'_>

The resulting type after applying the % operator.
Source§

fn rem(self, other: Self) -> Self

Performs the % operation. Read more
Source§

impl Sub for AnyValue<'_>

Source§

type Output = AnyValue<'_>

The resulting type after applying the - operator.
Source§

fn sub(self, other: Self) -> Self

Performs the - operation. Read more
Source§

impl<'a> Eq for AnyValue<'a>

Auto Trait Implementations§

§

impl<'a> Freeze for AnyValue<'a>

§

impl<'a> RefUnwindSafe for AnyValue<'a>

§

impl<'a> Send for AnyValue<'a>

§

impl<'a> Sync for AnyValue<'a>

§

impl<'a> Unpin for AnyValue<'a>

§

impl<'a> UnsafeUnpin for AnyValue<'a>

§

impl<'a> UnwindSafe for AnyValue<'a>

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, dest: *mut u8)

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

impl<Q, K> Comparable<K> for Q
where Q: Ord + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn compare(&self, key: &K) -> Ordering

Compare self to key and return their ordering.
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
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> 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, 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, Rhs, Output> NumOps<Rhs, Output> for T
where T: Sub<Rhs, Output = Output> + Mul<Rhs, Output = Output> + Div<Rhs, Output = Output> + Add<Rhs, Output = Output> + Rem<Rhs, Output = Output>,