Expr

Enum Expr 

pub enum Expr {
Show 63 variants Identifier(Ident), CompoundIdentifier(Vec<Ident>), CompoundFieldAccess { root: Box<Expr>, access_chain: Vec<AccessExpr>, }, JsonAccess { value: Box<Expr>, path: JsonPath, }, 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>), IsNormalized { expr: Box<Expr>, form: Option<NormalizationForm>, negated: bool, }, 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, any: bool, expr: Box<Expr>, pattern: Box<Expr>, escape_char: Option<Value>, }, ILike { negated: bool, any: bool, expr: Box<Expr>, pattern: Box<Expr>, escape_char: Option<Value>, }, SimilarTo { negated: bool, expr: Box<Expr>, pattern: Box<Expr>, escape_char: Option<Value>, }, RLike { negated: bool, expr: Box<Expr>, pattern: Box<Expr>, regexp: bool, }, AnyOp { left: Box<Expr>, compare_op: BinaryOperator, right: Box<Expr>, is_some: bool, }, AllOp { left: Box<Expr>, compare_op: BinaryOperator, right: Box<Expr>, }, UnaryOp { op: UnaryOperator, expr: Box<Expr>, }, Convert { is_try: bool, expr: Box<Expr>, data_type: Option<DataType>, charset: Option<ObjectName>, target_before_value: bool, styles: Vec<Expr>, }, Cast { kind: CastKind, expr: Box<Expr>, data_type: DataType, array: bool, format: Option<CastFormat>, }, AtTimeZone { timestamp: Box<Expr>, time_zone: Box<Expr>, }, Extract { field: DateTimeField, syntax: ExtractSyntax, expr: Box<Expr>, }, Ceil { expr: Box<Expr>, field: CeilFloorKind, }, Floor { expr: Box<Expr>, field: CeilFloorKind, }, Position { expr: Box<Expr>, in: Box<Expr>, }, Substring { expr: Box<Expr>, substring_from: Option<Box<Expr>>, substring_for: Option<Box<Expr>>, special: bool, shorthand: 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(ValueWithSpan), Prefixed { prefix: Ident, value: Box<Expr>, }, TypedString(TypedString), Function(Function), Case { case_token: AttachedToken, end_token: AttachedToken, operand: Option<Box<Expr>>, conditions: Vec<CaseWhen>, else_result: Option<Box<Expr>>, }, Exists { subquery: Box<Query>, negated: bool, }, Subquery(Box<Query>), 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>), Map(Map), Array(Array), Interval(Interval), MatchAgainst { columns: Vec<ObjectName>, match_value: Value, opt_search_modifier: Option<SearchModifier>, }, Wildcard(AttachedToken), QualifiedWildcard(ObjectName, AttachedToken), OuterJoin(Box<Expr>), Prior(Box<Expr>), Lambda(LambdaFunction), MemberOf(MemberOf),
}
Expand description

An SQL expression of any type.

§Semantics / Type Checking

The parser does not distinguish between expressions of different types (e.g. boolean vs string). The caller is responsible for detecting and validating types as necessary (for example WHERE 1 vs SELECT 1=1) See the README.md for more details.

§Equality and Hashing Does not Include Source Locations

The Expr type implements PartialEq and Eq based on the semantic value of the expression (not bitwise comparison). This means that Expr instances that are semantically equivalent but have different spans (locations in the source tree) will compare as equal.

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

§

CompoundFieldAccess

Multi-part expression access.

This structure represents an access chain in structured / nested types such as maps, arrays, and lists:

  • Array
    • A 1-dim array a[1] will be represented like: CompoundFieldAccess(Ident('a'), vec![Subscript(1)]
    • A 2-dim array a[1][2] will be represented like: CompoundFieldAccess(Ident('a'), vec![Subscript(1), Subscript(2)]
  • Map or Struct (Bracket-style)
    • A map a['field1'] will be represented like: CompoundFieldAccess(Ident('a'), vec![Subscript('field')]
    • A 2-dim map a['field1']['field2'] will be represented like: CompoundFieldAccess(Ident('a'), vec![Subscript('field1'), Subscript('field2')]
  • Struct (Dot-style) (only effect when the chain contains both subscript and expr)
    • A struct access a[field1].field2 will be represented like: CompoundFieldAccess(Ident('a'), vec![Subscript('field1'), Ident('field2')]
  • If a struct access likes a.field1.field2, it will be represented by CompoundIdentifier([a, field1, field2])

Fields

§root: Box<Expr>

The base expression being accessed.

§access_chain: Vec<AccessExpr>

Sequence of access operations (subscript or identifier accesses).

§

JsonAccess

Access data nested in a value containing semi-structured data, such as the VARIANT type on Snowflake. for example src:customer[0].name.

See https://docs.snowflake.com/en/user-guide/querying-semistructured. See https://docs.databricks.com/en/sql/language-manual/functions/colonsign.html.

Fields

§value: Box<Expr>

The value being queried.

§path: JsonPath

The path to the data to extract.

§

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

§

IsNormalized

<expr> IS [ NOT ] [ form ] NORMALIZED

Fields

§expr: Box<Expr>

Expression being tested.

§form: Option<NormalizationForm>

Optional normalization form (e.g., NFC, NFD).

§negated: bool

true when NOT is present.

§

InList

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

Fields

§expr: Box<Expr>

Left-hand expression to test for membership.

§list: Vec<Expr>

Literal list of expressions to check against.

§negated: bool

true when the NOT modifier is present.

§

InSubquery

[ NOT ] IN (SELECT ...)

Fields

§expr: Box<Expr>

Left-hand expression to test for membership.

§subquery: Box<Query>

The subquery providing the candidate values.

§negated: bool

true when the NOT modifier is present.

§

InUnnest

[ NOT ] IN UNNEST(array_expression)

Fields

§expr: Box<Expr>

Left-hand expression to test for membership.

§array_expr: Box<Expr>

Array expression being unnested.

§negated: bool

true when the NOT modifier is present.

§

Between

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

Fields

§expr: Box<Expr>

Expression being compared.

§negated: bool

true when the NOT modifier is present.

§low: Box<Expr>

Lower bound.

§high: Box<Expr>

Upper bound.

§

BinaryOp

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

Fields

§left: Box<Expr>

Left operand.

§op: BinaryOperator

Operator between operands.

§right: Box<Expr>

Right operand.

§

Like

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

Fields

§negated: bool

true when NOT is present.

§any: bool

Snowflake supports the ANY keyword to match against a list of patterns https://docs.snowflake.com/en/sql-reference/functions/like_any

§expr: Box<Expr>

Expression to match.

§pattern: Box<Expr>

Pattern expression.

§escape_char: Option<Value>

Optional escape character.

§

ILike

ILIKE (case-insensitive LIKE)

Fields

§negated: bool

true when NOT is present.

§any: bool

Snowflake supports the ANY keyword to match against a list of patterns https://docs.snowflake.com/en/sql-reference/functions/like_any

§expr: Box<Expr>

Expression to match.

§pattern: Box<Expr>

Pattern expression.

§escape_char: Option<Value>

Optional escape character.

§

SimilarTo

SIMILAR TO regex

Fields

§negated: bool

true when NOT is present.

§expr: Box<Expr>

Expression to test.

§pattern: Box<Expr>

Pattern expression.

§escape_char: Option<Value>

Optional escape character.

§

RLike

MySQL: RLIKE regex or REGEXP regex

Fields

§negated: bool

true when NOT is present.

§expr: Box<Expr>

Expression to test.

§pattern: Box<Expr>

Pattern expression.

§regexp: bool

true for REGEXP, false for RLIKE (no difference in semantics)

§

AnyOp

ANY operation e.g. foo > ANY(bar), comparison operator is one of [=, >, <, =>, =<, !=] https://docs.snowflake.com/en/sql-reference/operators-subquery#all-any

Fields

§left: Box<Expr>

Left operand.

§compare_op: BinaryOperator

Comparison operator.

§right: Box<Expr>

Right-hand subquery expression.

§

AllOp

ALL operation e.g. foo > ALL(bar), comparison operator is one of [=, >, <, =>, =<, !=] https://docs.snowflake.com/en/sql-reference/operators-subquery#all-any

Fields

§left: Box<Expr>

Left operand.

§compare_op: BinaryOperator

Comparison operator.

§right: Box<Expr>

Right-hand subquery expression.

§

UnaryOp

Unary operation e.g. NOT foo

Fields

§op: UnaryOperator

The unary operator (e.g., NOT, -).

§expr: Box<Expr>

Operand expression.

§

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, if provided.

§charset: Option<ObjectName>

Optional target character encoding (e.g., utf8mb4).

§target_before_value: bool

true when target precedes the value (MSSQL syntax).

§styles: Vec<Expr>

How to translate the expression.

§

Cast

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

Fields

§kind: CastKind

The cast kind (e.g., CAST, TRY_CAST).

§expr: Box<Expr>

Expression being cast.

§data_type: DataType

Target data type.

§array: bool

MySQL allows CAST(… AS type ARRAY) in functional index definitions for InnoDB multi-valued indices. It’s not really a datatype, and is only allowed in CAST in key specifications, so it’s a flag here.

§format: Option<CastFormat>

Optional CAST(string_expression AS type FORMAT format_string_expression) as used by BigQuery

§

AtTimeZone

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

Fields

§timestamp: Box<Expr>

Timestamp expression to shift.

§time_zone: Box<Expr>

Time zone expression to apply.

§

Extract

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

Syntax:

EXTRACT(DateTimeField FROM <expr>) | EXTRACT(DateTimeField, <expr>)

Fields

§field: DateTimeField

Which datetime field is being extracted.

§syntax: ExtractSyntax

Syntax variant used (From or Comma).

§expr: Box<Expr>

Expression to extract from.

§

Ceil

CEIL(<expr> [TO DateTimeField])
CEIL( <input_expr> [, <scale_expr> ] )

Fields

§expr: Box<Expr>

Expression to ceil.

§field: CeilFloorKind

The CEIL/FLOOR kind (datetime field or scale).

§

Floor

FLOOR(<expr> [TO DateTimeField])
FLOOR( <input_expr> [, <scale_expr> ] )

Fields

§expr: Box<Expr>

Expression to floor.

§field: CeilFloorKind

The CEIL/FLOOR kind (datetime field or scale).

§

Position

POSITION(<expr> in <expr>)

Fields

§expr: Box<Expr>

Expression to search for.

§in: Box<Expr>

Expression to search in.

§

Substring

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

or

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

Fields

§expr: Box<Expr>

Source expression.

§substring_from: Option<Box<Expr>>

Optional FROM expression.

§substring_for: Option<Box<Expr>>

Optional FOR expression.

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

§shorthand: bool

true if the expression is represented using the SUBSTR shorthand 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>

The expression to trim from.

§trim_where: Option<TrimWhereField>

Which side to trim: BOTH, LEADING, or TRAILING.

§trim_what: Option<Box<Expr>>

Optional expression specifying what to trim from the value.

§trim_characters: Option<Vec<Expr>>

Optional list of characters to trim (dialect-specific).

§

Overlay

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

Fields

§expr: Box<Expr>

The target expression being overlayed.

§overlay_what: Box<Expr>

The expression to place into the target.

§overlay_from: Box<Expr>

The FROM position expression indicating where to start overlay.

§overlay_for: Option<Box<Expr>>

Optional FOR length expression limiting the overlay span.

§

Collate

expr COLLATE collation

Fields

§expr: Box<Expr>

The expression being collated.

§collation: ObjectName

The collation name to apply to the expression.

§

Nested(Box<Expr>)

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

§

Value(ValueWithSpan)

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

§

Prefixed

Fields

§prefix: Ident

The prefix identifier (introducer or projection prefix).

§value: Box<Expr>

The value expression being prefixed. Hint: you can unwrap the string value using value.into_string().

§

TypedString(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).

§

Function(Function)

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

§

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

§case_token: AttachedToken

The attached CASE token (keeps original spacing/comments).

§end_token: AttachedToken

The attached END token (keeps original spacing/comments).

§operand: Option<Box<Expr>>

Optional operand expression after CASE (for simple CASE).

§conditions: Vec<CaseWhen>

The WHEN ... THEN conditions and results.

§else_result: Option<Box<Expr>>

Optional ELSE result expression.

§

Exists

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

Fields

§subquery: Box<Query>

The subquery checked by EXISTS.

§negated: bool

Whether the EXISTS is negated (NOT EXISTS).

§

Subquery(Box<Query>)

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

§

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

Struct literal expression Syntax:

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

[BigQuery](https://cloud.google.com/bigquery/docs/reference/standard-sql/data-types#struct_type)
[Databricks](https://docs.databricks.com/en/sql/language-manual/functions/struct.html)

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>

The expression being named.

§name: Ident

The assigned identifier name for the expression.

§

Dictionary(Vec<DictionaryField>)

DuckDB specific Struct literal expression 1

Syntax:

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

Map(Map)

DuckDB specific Map literal expression 1

Syntax:

syntax: Map {key1: value1[, ... ]}
§

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<ObjectName>

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

§match_value: Value

<expr>.

§opt_search_modifier: Option<SearchModifier>

<search modifier>

§

Wildcard(AttachedToken)

An unqualified * wildcard token (e.g. *).

§

QualifiedWildcard(ObjectName, AttachedToken)

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.

§

Prior(Box<Expr>)

A reference to the prior level in a CONNECT BY clause.

§

Lambda(LambdaFunction)

A lambda function.

Syntax:

param -> expr | (param1, ...) -> expr

ClickHouse Databricks DuckDB

§

MemberOf(MemberOf)

Checks membership of a value in a JSON array

Implementations§

§

impl Expr

pub fn value(value: impl Into<ValueWithSpan>) -> Expr

Creates a new Expr::Value

Trait Implementations§

§

impl Clone for Expr

§

fn clone(&self) -> Expr

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
§

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 Spanned for Expr

§partial span

Most expressions are missing keywords in their spans. f.e. IS NULL <expr> reports as <expr>::span.

Missing spans:

§

fn span(&self) -> Span

Return the [Span] (the minimum and maximum Location) for this AST node, by recursively combining the spans of its children.
§

impl Visit for Expr

§

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

Visit this node with the provided Visitor. Read more
§

impl VisitMut for Expr

§

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

Mutably visit this node with the provided VisitorMut. Read more
§

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

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> DynEq for T
where T: Eq + Any,

§

fn dyn_eq(&self, other: &(dyn Any + 'static)) -> bool

§

impl<T> DynHash for T
where T: Hash + Any,

§

fn dyn_hash(&self, state: &mut dyn Hasher)

§

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

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
§

impl<T> IntoRequest<T> for T

§

fn into_request(self) -> Request<T>

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

impl<T> IntoRequest<T> for T

§

fn into_request(self) -> Request<T>

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

impl<L> LayerExt<L> for L

§

fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>
where L: Layer<S>,

Applies the layer to a service and wraps it in [Layered].
§

impl<L> LayerExt<L> for L

§

fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>
where L: Layer<S>,

Applies the layer to a service and wraps it in [Layered].
§

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> PolicyExt for T
where T: ?Sized,

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] only if self and other return Action::Follow. Read more
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
§

impl<T> ServiceExt for T

§

fn propagate_header(self, header: HeaderName) -> PropagateHeader<Self>
where Self: Sized,

Propagate a header from the request to the response. Read more
§

fn add_extension<T>(self, value: T) -> AddExtension<Self, T>
where Self: Sized,

Add some shareable value to request extensions. Read more
§

fn map_request_body<F>(self, f: F) -> MapRequestBody<Self, F>
where Self: Sized,

Apply a transformation to the request body. Read more
§

fn map_response_body<F>(self, f: F) -> MapResponseBody<Self, F>
where Self: Sized,

Apply a transformation to the response body. Read more
§

fn compression(self) -> Compression<Self>
where Self: Sized,

Compresses response bodies. Read more
§

fn decompression(self) -> Decompression<Self>
where Self: Sized,

Decompress response bodies. Read more
§

fn trace_for_http(self) -> Trace<Self, SharedClassifier<ServerErrorsAsFailures>>
where Self: Sized,

High level tracing that classifies responses using HTTP status codes. Read more
§

fn trace_for_grpc(self) -> Trace<Self, SharedClassifier<GrpcErrorsAsFailures>>
where Self: Sized,

High level tracing that classifies responses using gRPC headers. Read more
§

fn follow_redirects(self) -> FollowRedirect<Self>
where Self: Sized,

Follow redirect resposes using the Standard policy. Read more
§

fn sensitive_headers( self, headers: impl IntoIterator<Item = HeaderName>, ) -> SetSensitiveRequestHeaders<SetSensitiveResponseHeaders<Self>>
where Self: Sized,

Mark headers as sensitive on both requests and responses. Read more
§

fn sensitive_request_headers( self, headers: impl IntoIterator<Item = HeaderName>, ) -> SetSensitiveRequestHeaders<Self>
where Self: Sized,

Mark headers as sensitive on requests. Read more
§

fn sensitive_response_headers( self, headers: impl IntoIterator<Item = HeaderName>, ) -> SetSensitiveResponseHeaders<Self>
where Self: Sized,

Mark headers as sensitive on responses. Read more
§

fn override_request_header<M>( self, header_name: HeaderName, make: M, ) -> SetRequestHeader<Self, M>
where Self: Sized,

Insert a header into the request. Read more
§

fn append_request_header<M>( self, header_name: HeaderName, make: M, ) -> SetRequestHeader<Self, M>
where Self: Sized,

Append a header into the request. Read more
§

fn insert_request_header_if_not_present<M>( self, header_name: HeaderName, make: M, ) -> SetRequestHeader<Self, M>
where Self: Sized,

Insert a header into the request, if the header is not already present. Read more
§

fn override_response_header<M>( self, header_name: HeaderName, make: M, ) -> SetResponseHeader<Self, M>
where Self: Sized,

Insert a header into the response. Read more
§

fn append_response_header<M>( self, header_name: HeaderName, make: M, ) -> SetResponseHeader<Self, M>
where Self: Sized,

Append a header into the response. Read more
§

fn insert_response_header_if_not_present<M>( self, header_name: HeaderName, make: M, ) -> SetResponseHeader<Self, M>
where Self: Sized,

Insert a header into the response, if the header is not already present. Read more
§

fn set_request_id<M>( self, header_name: HeaderName, make_request_id: M, ) -> SetRequestId<Self, M>
where Self: Sized, M: MakeRequestId,

Add request id header and extension. Read more
§

fn set_x_request_id<M>(self, make_request_id: M) -> SetRequestId<Self, M>
where Self: Sized, M: MakeRequestId,

Add request id header and extension, using x-request-id as the header name. Read more
§

fn propagate_request_id( self, header_name: HeaderName, ) -> PropagateRequestId<Self>
where Self: Sized,

Propgate request ids from requests to responses. Read more
§

fn propagate_x_request_id(self) -> PropagateRequestId<Self>
where Self: Sized,

Propgate request ids from requests to responses, using x-request-id as the header name. Read more
§

fn catch_panic(self) -> CatchPanic<Self, DefaultResponseForPanic>
where Self: Sized,

Catch panics and convert them into 500 Internal Server responses. Read more
§

fn request_body_limit(self, limit: usize) -> RequestBodyLimit<Self>
where Self: Sized,

Intercept requests with over-sized payloads and convert them into 413 Payload Too Large responses. Read more
§

fn trim_trailing_slash(self) -> NormalizePath<Self>
where Self: Sized,

Remove trailing slashes from paths. Read more
§

fn append_trailing_slash(self) -> NormalizePath<Self>
where Self: Sized,

Append trailing slash to paths. Read more
§

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§

fn to_string(&self) -> String

Converts the given value to a String. Read more
§

impl<T> ToStringFallible for T
where T: Display,

§

fn try_to_string(&self) -> Result<String, TryReserveError>

ToString::to_string, but without panic on OOM.

§

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> ErasedDestructor for T
where T: 'static,

§

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