Skip to main content

ExtensionValue

Enum ExtensionValue 

Source
pub enum ExtensionValue {
    String(String),
    Integer(i64),
    Float(f64),
    Boolean(bool),
    Expr(Expr),
    Enum(String),
    Tuple(TupleValue),
}
Expand description

Represents a value in extension arguments.

These values are the structured form of text-format extension arguments, fully resolved - i.e. any additional context (such as function anchors etc) are part of this struct itself.

Variants§

§

String(String)

Untyped literals. These are not input or output with types (e.g. 2, not 2:i64), and suitable for protobuf extension fields that are not substrait types.

§

Integer(i64)

§

Float(f64)

§

Boolean(bool)

§

Expr(Expr)

Substrait expression value, including typed literals and field references.

Use TryFrom<&ExtensionValue> for Expr when a handler accepts either an expression or a scalar value widened into an expression.

§

Enum(String)

Enum value (e.g. &CORE, &Inner) — the string holds the identifier without the & prefix

§

Tuple(TupleValue)

Tuple of values, e.g. (&HASH, &RANGE) or (42, ‘hello’)

Implementations§

Source§

impl ExtensionValue

Source

pub fn kind(&self) -> ExtensionValueKind

Return the variant kind of this value for structured diagnostics.

Trait Implementations§

Source§

impl Clone for ExtensionValue

Source§

fn clone(&self) -> ExtensionValue

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 Debug for ExtensionValue

Source§

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

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

impl From<&str> for ExtensionValue

Source§

fn from(value: &str) -> Self

Converts to this type from the input type.
Source§

impl From<Expr> for ExtensionValue

Source§

fn from(expr: Expr) -> Self

Converts to this type from the input type.
Source§

impl From<Expression> for ExtensionValue

Source§

fn from(expr: Expression) -> Self

Converts to this type from the input type.
Source§

impl From<Literal> for ExtensionValue

Source§

fn from(literal: Literal) -> Self

Converts to this type from the input type.
Source§

impl From<Reference> for ExtensionValue

Source§

fn from(reference: Reference) -> Self

Converts to this type from the input type.
Source§

impl From<String> for ExtensionValue

Source§

fn from(value: String) -> Self

Converts to this type from the input type.
Source§

impl From<bool> for ExtensionValue

Source§

fn from(value: bool) -> Self

Converts to this type from the input type.
Source§

impl From<f64> for ExtensionValue

Source§

fn from(value: f64) -> Self

Converts to this type from the input type.
Source§

impl From<i64> for ExtensionValue

Source§

fn from(value: i64) -> Self

Converts to this type from the input type.
Source§

impl FromIterator<ExtensionValue> for TupleValue

Source§

fn from_iter<I: IntoIterator<Item = ExtensionValue>>(iter: I) -> Self

Creates a value from an iterator. Read more
Source§

impl ScopedParsePair for ExtensionValue

Source§

fn rule() -> Rule

Source§

fn message() -> &'static str

Source§

fn parse_pair( extensions: &SimpleExtensions, pair: Pair<'_, Rule>, ) -> Result<Self, MessageParseError>

Source§

impl Textify for ExtensionValue

Source§

fn name() -> &'static str

Source§

fn textify<S: Scope, W: Write>(&self, ctx: &S, w: &mut W) -> Result

Source§

impl<'a> TryFrom<&'a ExtensionValue> for &'a TupleValue

Source§

type Error = ExtensionError

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

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

Performs the conversion.
Source§

impl<'a> TryFrom<&'a ExtensionValue> for &'a str

Source§

type Error = ExtensionError

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

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

Performs the conversion.
Source§

impl<'a> TryFrom<&'a ExtensionValue> for EnumValue

Source§

type Error = ExtensionError

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

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

Performs the conversion.
Source§

impl TryFrom<&ExtensionValue> for Expr

Source§

type Error = ExtensionError

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

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

Performs the conversion.
Source§

impl TryFrom<&ExtensionValue> for Reference

Source§

type Error = ExtensionError

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

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

Performs the conversion.
Source§

impl TryFrom<&ExtensionValue> for bool

Source§

type Error = ExtensionError

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

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

Performs the conversion.
Source§

impl TryFrom<&ExtensionValue> for f64

Source§

type Error = ExtensionError

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

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

Performs the conversion.
Source§

impl TryFrom<&ExtensionValue> for i64

Source§

type Error = ExtensionError

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

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

Performs the conversion.
Source§

impl TryFrom<ExtensionValue> for String

Source§

type Error = ExtensionError

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

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

Performs the conversion.

Auto Trait Implementations§

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<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> ScopedParse for T
where T: ScopedParsePair,

Source§

fn parse( extensions: &SimpleExtensions, input: &str, ) -> Result<T, MessageParseError>

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.