sql::ast

Enum Expr

pub enum Expr {
Show 66 variants Identifier(Ident), CompoundIdentifier(Vec<Ident>), JsonAccess { left: Box<Expr>, operator: JsonOperator, right: Box<Expr>, }, CompositeAccess { expr: Box<Expr>, key: Ident, }, IsFalse(Box<Expr>), IsNotFalse(Box<Expr>), IsTrue(Box<Expr>), IsNotTrue(Box<Expr>), IsNull(Box<Expr>), IsNotNull(Box<Expr>), IsUnknown(Box<Expr>), IsNotUnknown(Box<Expr>), IsDistinctFrom(Box<Expr>, Box<Expr>), IsNotDistinctFrom(Box<Expr>, Box<Expr>), InList { expr: Box<Expr>, list: Vec<Expr>, negated: bool, }, InSubquery { expr: Box<Expr>, subquery: Box<Query>, negated: bool, }, InUnnest { expr: Box<Expr>, array_expr: Box<Expr>, negated: bool, }, Between { expr: Box<Expr>, negated: bool, low: Box<Expr>, high: Box<Expr>, }, BinaryOp { left: Box<Expr>, op: BinaryOperator, right: Box<Expr>, }, Like { negated: bool, expr: Box<Expr>, pattern: Box<Expr>, escape_char: Option<char>, }, ILike { negated: bool, expr: Box<Expr>, pattern: Box<Expr>, escape_char: Option<char>, }, SimilarTo { negated: bool, expr: Box<Expr>, pattern: Box<Expr>, escape_char: Option<char>, }, RLike { negated: bool, expr: Box<Expr>, pattern: Box<Expr>, regexp: bool, }, AnyOp { left: Box<Expr>, compare_op: BinaryOperator, right: Box<Expr>, }, AllOp { left: Box<Expr>, compare_op: BinaryOperator, right: Box<Expr>, }, UnaryOp { op: UnaryOperator, expr: Box<Expr>, }, Convert { expr: Box<Expr>, data_type: Option<DataType>, charset: Option<ObjectName>, target_before_value: bool, }, Cast { expr: Box<Expr>, data_type: DataType, format: Option<CastFormat>, }, TryCast { expr: Box<Expr>, data_type: DataType, format: Option<CastFormat>, }, SafeCast { expr: Box<Expr>, data_type: DataType, format: Option<CastFormat>, }, AtTimeZone { timestamp: Box<Expr>, time_zone: String, }, Extract { field: DateTimeField, expr: Box<Expr>, }, Ceil { expr: Box<Expr>, field: DateTimeField, }, Floor { expr: Box<Expr>, field: DateTimeField, }, Position { expr: Box<Expr>, in: Box<Expr>, }, Substring { expr: Box<Expr>, substring_from: Option<Box<Expr>>, substring_for: Option<Box<Expr>>, special: bool, }, Trim { expr: Box<Expr>, trim_where: Option<TrimWhereField>, trim_what: Option<Box<Expr>>, trim_characters: Option<Vec<Expr>>, }, Overlay { expr: Box<Expr>, overlay_what: Box<Expr>, overlay_from: Box<Expr>, overlay_for: Option<Box<Expr>>, }, Collate { expr: Box<Expr>, collation: ObjectName, }, Nested(Box<Expr>), Value(Value), IntroducedString { introducer: String, value: Value, }, TypedString { data_type: DataType, value: String, }, MapAccess { column: Box<Expr>, keys: Vec<MapAccessKey>, }, Function(Function), AggregateExpressionWithFilter { expr: Box<Expr>, filter: Box<Expr>, }, Case { operand: Option<Box<Expr>>, conditions: Vec<Expr>, results: Vec<Expr>, else_result: Option<Box<Expr>>, }, Exists { subquery: Box<Query>, negated: bool, }, Subquery(Box<Query>), ArraySubquery(Box<Query>), ListAgg(ListAgg), ArrayAgg(ArrayAgg), GroupingSets(Vec<Vec<Expr>>), Cube(Vec<Vec<Expr>>), Rollup(Vec<Vec<Expr>>), Tuple(Vec<Expr>), Struct { values: Vec<Expr>, fields: Vec<StructField>, }, Named { expr: Box<Expr>, name: Ident, }, Dictionary(Vec<DictionaryField>), ArrayIndex { obj: Box<Expr>, indexes: Vec<Expr>, }, Array(Array), Interval(Interval), MatchAgainst { columns: Vec<Ident>, match_value: Value, opt_search_modifier: Option<SearchModifier>, }, Wildcard, QualifiedWildcard(ObjectName), OuterJoin(Box<Expr>),
}
Expand description

An SQL expression of any type.

The parser does not distinguish between expressions of different types (e.g. boolean vs string), so the caller must handle expressions of inappropriate type, like WHERE 1 or SELECT 1=1, as necessary.

Variants§

§

Identifier(Ident)

Identifier e.g. table name or column name

§

CompoundIdentifier(Vec<Ident>)

Multi-part identifier, e.g. table_alias.column or schema.table.col

§

JsonAccess

JSON access (postgres) eg: data->‘tags’

Fields

§left: Box<Expr>
§operator: JsonOperator
§right: Box<Expr>
§

CompositeAccess

CompositeAccess (postgres) eg: SELECT (information_schema._pg_expandarray(array[‘i’,‘i’])).n

Fields

§expr: Box<Expr>
§key: Ident
§

IsFalse(Box<Expr>)

IS FALSE operator

§

IsNotFalse(Box<Expr>)

IS NOT FALSE operator

§

IsTrue(Box<Expr>)

IS TRUE operator

§

IsNotTrue(Box<Expr>)

IS NOT TRUE operator

§

IsNull(Box<Expr>)

IS NULL operator

§

IsNotNull(Box<Expr>)

IS NOT NULL operator

§

IsUnknown(Box<Expr>)

IS UNKNOWN operator

§

IsNotUnknown(Box<Expr>)

IS NOT UNKNOWN operator

§

IsDistinctFrom(Box<Expr>, Box<Expr>)

IS DISTINCT FROM operator

§

IsNotDistinctFrom(Box<Expr>, Box<Expr>)

IS NOT DISTINCT FROM operator

§

InList

[ NOT ] IN (val1, val2, ...)

Fields

§expr: Box<Expr>
§list: Vec<Expr>
§negated: bool
§

InSubquery

[ NOT ] IN (SELECT ...)

Fields

§expr: Box<Expr>
§subquery: Box<Query>
§negated: bool
§

InUnnest

[ NOT ] IN UNNEST(array_expression)

Fields

§expr: Box<Expr>
§array_expr: Box<Expr>
§negated: bool
§

Between

<expr> [ NOT ] BETWEEN <low> AND <high>

Fields

§expr: Box<Expr>
§negated: bool
§low: Box<Expr>
§high: Box<Expr>
§

BinaryOp

Binary operation e.g. 1 + 1 or foo > bar

Fields

§left: Box<Expr>
§right: Box<Expr>
§

Like

[NOT] LIKE <pattern> [ESCAPE <escape_character>]

Fields

§negated: bool
§expr: Box<Expr>
§pattern: Box<Expr>
§escape_char: Option<char>
§

ILike

ILIKE (case-insensitive LIKE)

Fields

§negated: bool
§expr: Box<Expr>
§pattern: Box<Expr>
§escape_char: Option<char>
§

SimilarTo

SIMILAR TO regex

Fields

§negated: bool
§expr: Box<Expr>
§pattern: Box<Expr>
§escape_char: Option<char>
§

RLike

MySQL: RLIKE regex or REGEXP regex

Fields

§negated: bool
§expr: Box<Expr>
§pattern: Box<Expr>
§regexp: bool
§

AnyOp

ANY operation e.g. foo > ANY(bar), comparison operator is one of [=, >, <, =>, =<, !=]

Fields

§left: Box<Expr>
§compare_op: BinaryOperator
§right: Box<Expr>
§

AllOp

ALL operation e.g. foo > ALL(bar), comparison operator is one of [=, >, <, =>, =<, !=]

Fields

§left: Box<Expr>
§compare_op: BinaryOperator
§right: Box<Expr>
§

UnaryOp

Unary operation e.g. NOT foo

Fields

§op: UnaryOperator
§expr: Box<Expr>
§

Convert

CONVERT a value to a different data type or character encoding. e.g. CONVERT(foo USING utf8mb4)

Fields

§expr: Box<Expr>

The expression to convert

§data_type: Option<DataType>

The target data type

§charset: Option<ObjectName>

The target character encoding

§target_before_value: bool

whether the target comes before the expr (MSSQL syntax)

§

Cast

CAST an expression to a different data type e.g. CAST(foo AS VARCHAR(123))

Fields

§expr: Box<Expr>
§data_type: DataType
§format: Option<CastFormat>
§

TryCast

TRY_CAST an expression to a different data type e.g. TRY_CAST(foo AS VARCHAR(123))

Fields

§expr: Box<Expr>
§data_type: DataType
§format: Option<CastFormat>
§

SafeCast

SAFE_CAST an expression to a different data type e.g. SAFE_CAST(foo AS FLOAT64)

Fields

§expr: Box<Expr>
§data_type: DataType
§format: Option<CastFormat>
§

AtTimeZone

AT a timestamp to a different timezone e.g. FROM_UNIXTIME(0) AT TIME ZONE 'UTC-06:00'

Fields

§timestamp: Box<Expr>
§time_zone: String
§

Extract

Extract a field from a timestamp e.g. EXTRACT(MONTH FROM foo)

Syntax:

EXTRACT(DateTimeField FROM <expr>)

Fields

§field: DateTimeField
§expr: Box<Expr>
§

Ceil

CEIL(<expr> [TO DateTimeField])

Fields

§expr: Box<Expr>
§field: DateTimeField
§

Floor

FLOOR(<expr> [TO DateTimeField])

Fields

§expr: Box<Expr>
§field: DateTimeField
§

Position

POSITION(<expr> in <expr>)

Fields

§expr: Box<Expr>
§in: Box<Expr>
§

Substring

SUBSTRING(<expr> [FROM <expr>] [FOR <expr>])

or

SUBSTRING(<expr>, <expr>, <expr>)

Fields

§expr: Box<Expr>
§substring_from: Option<Box<Expr>>
§substring_for: Option<Box<Expr>>
§special: bool

false if the expression is represented using the SUBSTRING(expr [FROM start] [FOR len]) syntax true if the expression is represented using the SUBSTRING(expr, start, len) syntax This flag is used for formatting.

§

Trim

TRIM([BOTH | LEADING | TRAILING] [<expr> FROM] <expr>)
TRIM(<expr>)
TRIM(<expr>, [, characters]) -- only Snowflake or Bigquery

Fields

§expr: Box<Expr>
§trim_where: Option<TrimWhereField>
§trim_what: Option<Box<Expr>>
§trim_characters: Option<Vec<Expr>>
§

Overlay

OVERLAY(<expr> PLACING <expr> FROM <expr>[ FOR <expr> ]

Fields

§expr: Box<Expr>
§overlay_what: Box<Expr>
§overlay_from: Box<Expr>
§overlay_for: Option<Box<Expr>>
§

Collate

expr COLLATE collation

Fields

§expr: Box<Expr>
§collation: ObjectName
§

Nested(Box<Expr>)

Nested expression e.g. (foo > bar) or (1)

§

Value(Value)

A literal value, such as string, number, date or NULL

§

IntroducedString

Fields

§introducer: String
§value: Value
§

TypedString

A constant of form <data_type> 'value'. This can represent ANSI SQL DATE, TIME, and TIMESTAMP literals (such as DATE '2020-01-01'), as well as constants of other types (a non-standard PostgreSQL extension).

Fields

§data_type: DataType
§value: String
§

MapAccess

Access a map-like object by field (e.g. column['field'] or column[4] Note that depending on the dialect, struct like accesses may be parsed as ArrayIndex or MapAccess https://clickhouse.com/docs/en/sql-reference/data-types/map/

Fields

§column: Box<Expr>
§keys: Vec<MapAccessKey>
§

Function(Function)

Scalar function call e.g. LEFT(foo, 5)

§

AggregateExpressionWithFilter

Aggregate function with filter

Fields

§expr: Box<Expr>
§filter: Box<Expr>
§

Case

CASE [<operand>] WHEN <condition> THEN <result> ... [ELSE <result>] END

Note we only recognize a complete single expression as <condition>, not < 0 nor 1, 2, 3 as allowed in a <simple when clause> per https://jakewheat.github.io/sql-overview/sql-2011-foundation-grammar.html#simple-when-clause

Fields

§operand: Option<Box<Expr>>
§conditions: Vec<Expr>
§results: Vec<Expr>
§else_result: Option<Box<Expr>>
§

Exists

An exists expression [ NOT ] EXISTS(SELECT ...), used in expressions like WHERE [ NOT ] EXISTS (SELECT ...).

Fields

§subquery: Box<Query>
§negated: bool
§

Subquery(Box<Query>)

A parenthesized subquery (SELECT ...), used in expression like SELECT (subquery) AS x or WHERE (subquery) = x

§

ArraySubquery(Box<Query>)

An array subquery constructor, e.g. SELECT ARRAY(SELECT 1 UNION SELECT 2)

§

ListAgg(ListAgg)

The LISTAGG function SELECT LISTAGG(...) WITHIN GROUP (ORDER BY ...)

§

ArrayAgg(ArrayAgg)

The ARRAY_AGG function SELECT ARRAY_AGG(... ORDER BY ...)

§

GroupingSets(Vec<Vec<Expr>>)

The GROUPING SETS expr.

§

Cube(Vec<Vec<Expr>>)

The CUBE expr.

§

Rollup(Vec<Vec<Expr>>)

The ROLLUP expr.

§

Tuple(Vec<Expr>)

ROW / TUPLE a single value, such as SELECT (1, 2)

§

Struct

BigQuery specific Struct literal expression 1 Syntax:

STRUCT<[field_name] field_type, ...>( expr1 [, ... ])

Fields

§values: Vec<Expr>

Struct values.

§fields: Vec<StructField>

Struct field definitions.

§

Named

BigQuery specific: An named expression in a typeless struct 1

Syntax

1 AS A

Fields

§expr: Box<Expr>
§name: Ident
§

Dictionary(Vec<DictionaryField>)

DuckDB specific Struct literal expression 1

Syntax:

syntax: {'field_name': expr1[, ... ]}
§

ArrayIndex

An array index expression e.g. (ARRAY[1, 2])[1] or (current_schemas(FALSE))[1]

Fields

§obj: Box<Expr>
§indexes: Vec<Expr>
§

Array(Array)

An array expression e.g. ARRAY[1, 2]

§

Interval(Interval)

An interval expression e.g. INTERVAL '1' YEAR

§

MatchAgainst

MySQL specific text search function (1).

Syntax:

MATCH (<col>, <col>, ...) AGAINST (<expr> [<search modifier>])

<col> = CompoundIdentifier
<expr> = String literal

Fields

§columns: Vec<Ident>

(<col>, <col>, ...).

§match_value: Value

<expr>.

§opt_search_modifier: Option<SearchModifier>

<search modifier>

§

Wildcard

§

QualifiedWildcard(ObjectName)

Qualified wildcard, e.g. alias.* or schema.table.*. (Same caveats apply to QualifiedWildcard as to Wildcard.)

§

OuterJoin(Box<Expr>)

Some dialects support an older syntax for outer joins where columns are marked with the (+) operator in the WHERE clause, for example:

SELECT t1.c1, t2.c2 FROM t1, t2 WHERE t1.c1 = t2.c2 (+)

which is equivalent to

SELECT t1.c1, t2.c2 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c2

See https://docs.snowflake.com/en/sql-reference/constructs/where#joins-in-the-where-clause.

Trait Implementations§

§

impl Clone for Expr

§

fn clone(&self) -> Expr

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

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

Performs copy-assignment from source. Read more
§

impl Debug for Expr

§

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

Formats the value using the given formatter. Read more
§

impl<'de> Deserialize<'de> for Expr

§

fn deserialize<__D>( __deserializer: __D, ) -> Result<Expr, <__D as Deserializer<'de>>::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
§

impl Display for Expr

§

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

Formats the value using the given formatter. Read more
§

impl From<Expr> for FunctionArgExpr

§

fn from(wildcard_expr: Expr) -> FunctionArgExpr

Converts to this type from the input type.
§

impl Hash for Expr

§

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

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
§

impl Ord for Expr

§

fn cmp(&self, other: &Expr) -> 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
§

impl PartialEq for Expr

§

fn eq(&self, other: &Expr) -> 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.
§

impl PartialOrd for Expr

§

fn partial_cmp(&self, other: &Expr) -> 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
§

impl Serialize for Expr

§

fn serialize<__S>( &self, __serializer: __S, ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
§

impl Visit for Expr

§

fn visit<V>(&self, visitor: &mut V) -> ControlFlow<<V as Visitor>::Break>
where V: Visitor,

§

impl VisitMut for Expr

§

fn visit<V>(&mut self, visitor: &mut V) -> ControlFlow<<V as VisitorMut>::Break>
where V: VisitorMut,

§

impl Eq for Expr

§

impl StructuralPartialEq for Expr

Auto Trait Implementations§

§

impl Freeze for Expr

§

impl RefUnwindSafe for Expr

§

impl Send for Expr

§

impl Sync for Expr

§

impl Unpin for Expr

§

impl UnwindSafe for Expr

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
§

impl<T> CallHasher for T
where T: Hash + ?Sized,

§

default fn get_hash<H, B>(value: &H, build_hasher: &B) -> u64
where H: Hash + ?Sized, B: BuildHasher,

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
§

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

§

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

Compare self to key and return their ordering.
§

impl<T> Conv for T

§

fn conv<T>(self) -> T
where Self: Into<T>,

Converts self into T using Into<T>. Read more
§

impl<T, V> Convert<T> for V
where V: Into<T>,

§

fn convert(value: Self) -> T

§

fn convert_box(value: Box<Self>) -> Box<T>

§

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

§

fn convert_vec_box(value: Vec<Box<Self>>) -> Vec<Box<T>>

§

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

§

fn convert_option(value: Option<Self>) -> Option<T>

§

fn convert_option_box(value: Option<Box<Self>>) -> Option<Box<T>>

§

fn convert_option_vec(value: Option<Vec<Self>>) -> Option<Vec<T>>

§

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

§

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

Checks if this value is equivalent to the given key. Read more
§

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

§

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

Compare self to key and return true if they are equal.
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.
§

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

§

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

Checks if this value is equivalent to the given key. Read more
§

impl<T> FmtForward for T

§

fn fmt_binary(self) -> FmtBinary<Self>
where Self: Binary,

Causes self to use its Binary implementation when Debug-formatted.
§

fn fmt_display(self) -> FmtDisplay<Self>
where Self: Display,

Causes self to use its Display implementation when Debug-formatted.
§

fn fmt_lower_exp(self) -> FmtLowerExp<Self>
where Self: LowerExp,

Causes self to use its LowerExp implementation when Debug-formatted.
§

fn fmt_lower_hex(self) -> FmtLowerHex<Self>
where Self: LowerHex,

Causes self to use its LowerHex implementation when Debug-formatted.
§

fn fmt_octal(self) -> FmtOctal<Self>
where Self: Octal,

Causes self to use its Octal implementation when Debug-formatted.
§

fn fmt_pointer(self) -> FmtPointer<Self>
where Self: Pointer,

Causes self to use its Pointer implementation when Debug-formatted.
§

fn fmt_upper_exp(self) -> FmtUpperExp<Self>
where Self: UpperExp,

Causes self to use its UpperExp implementation when Debug-formatted.
§

fn fmt_upper_hex(self) -> FmtUpperHex<Self>
where Self: UpperHex,

Causes self to use its UpperHex implementation when Debug-formatted.
§

fn fmt_list(self) -> FmtList<Self>
where &'a Self: for<'a> IntoIterator,

Formats each item in a sequence. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

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

§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
§

impl<T> FutureExt for T

§

fn with_context(self, otel_cx: Context) -> WithContext<Self>

Attaches the provided Context to this type, returning a WithContext wrapper. Read more
§

fn with_current_context(self) -> WithContext<Self>

Attaches the current Context to this type, returning a WithContext wrapper. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoRequest<T> for T

source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
source§

impl<T> IntoRequest<T> for T

source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
§

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

§

fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> R
where Self: Sized,

Pipes by value. This is generally the method you want to use. Read more
§

fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> R
where R: 'a,

Borrows self and passes that borrow into the pipe function. Read more
§

fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> R
where R: 'a,

Mutably borrows self and passes that borrow into the pipe function. Read more
§

fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
where Self: Borrow<B>, B: 'a + ?Sized, R: 'a,

Borrows self, then passes self.borrow() into the pipe function. Read more
§

fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
where Self: BorrowMut<B>, B: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.borrow_mut() into the pipe function. Read more
§

fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
where Self: AsRef<U>, U: 'a + ?Sized, R: 'a,

Borrows self, then passes self.as_ref() into the pipe function.
§

fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
where Self: AsMut<U>, U: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.as_mut() into the pipe function.
§

fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
where Self: Deref<Target = T>, T: 'a + ?Sized, R: 'a,

Borrows self, then passes self.deref() into the pipe function.
§

fn pipe_deref_mut<'a, T, R>( &'a mut self, func: impl FnOnce(&'a mut T) -> R, ) -> R
where Self: DerefMut<Target = T> + Deref, T: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.deref_mut() into the pipe function.
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

source§

type Output = T

Should always be Self
§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
§

impl<T> Tap for T

§

fn tap(self, func: impl FnOnce(&Self)) -> Self

Immutable access to a value. Read more
§

fn tap_mut(self, func: impl FnOnce(&mut Self)) -> Self

Mutable access to a value. Read more
§

fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
where Self: Borrow<B>, B: ?Sized,

Immutable access to the Borrow<B> of a value. Read more
§

fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
where Self: BorrowMut<B>, B: ?Sized,

Mutable access to the BorrowMut<B> of a value. Read more
§

fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
where Self: AsRef<R>, R: ?Sized,

Immutable access to the AsRef<R> view of a value. Read more
§

fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
where Self: AsMut<R>, R: ?Sized,

Mutable access to the AsMut<R> view of a value. Read more
§

fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
where Self: Deref<Target = T>, T: ?Sized,

Immutable access to the Deref::Target of a value. Read more
§

fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
where Self: DerefMut<Target = T> + Deref, T: ?Sized,

Mutable access to the Deref::Target of a value. Read more
§

fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self

Calls .tap() only in debug builds, and is erased in release builds.
§

fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self

Calls .tap_mut() only in debug builds, and is erased in release builds.
§

fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
where Self: Borrow<B>, B: ?Sized,

Calls .tap_borrow() only in debug builds, and is erased in release builds.
§

fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
where Self: BorrowMut<B>, B: ?Sized,

Calls .tap_borrow_mut() only in debug builds, and is erased in release builds.
§

fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
where Self: AsRef<R>, R: ?Sized,

Calls .tap_ref() only in debug builds, and is erased in release builds.
§

fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
where Self: AsMut<R>, R: ?Sized,

Calls .tap_ref_mut() only in debug builds, and is erased in release builds.
§

fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
where Self: Deref<Target = T>, T: ?Sized,

Calls .tap_deref() only in debug builds, and is erased in release builds.
§

fn tap_deref_mut_dbg<T>(self, func: impl FnOnce(&mut T)) -> Self
where Self: DerefMut<Target = T> + Deref, T: ?Sized,

Calls .tap_deref_mut() only in debug builds, and is erased in release builds.
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
§

impl<T> TryConv for T

§

fn try_conv<T>(self) -> Result<T, Self::Error>
where Self: TryInto<T>,

Attempts to convert self into T using TryInto<T>. 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.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

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

§

impl<T> Any for T
where T: Any,

§

impl<T> CloneAny for T
where T: Any + Clone,

§

impl<T> CloneAnySend for T
where T: Any + Send + Clone,

§

impl<T> CloneAnySendSync for T
where T: Any + Send + Sync + Clone,

§

impl<T> CloneAnySync for T
where T: Any + Sync + Clone,

source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

§

impl<T> MaybeSend for T
where T: Send,

source§

impl<T> Scalar for T
where T: 'static + Clone + PartialEq + Debug,