Skip to main content

Expr

Enum Expr 

Source
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

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.

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

§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

Fields

§left: Box<Expr>

Left operand.

§compare_op: BinaryOperator

Comparison operator.

§right: Box<Expr>

Right-hand subquery expression.

§

AllOp

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§

Source§

impl Expr

Source

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

Creates a new Expr::Value

Trait Implementations§

Source§

impl Clone for Expr

Source§

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

impl Debug for Expr

Source§

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

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

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

Source§

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

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

impl Display for Expr

Source§

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

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

impl From<Expr> for FunctionArgExpr

Source§

fn from(wildcard_expr: Expr) -> Self

Converts to this type from the input type.
Source§

impl Hash for Expr

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

Source§

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

impl PartialEq for Expr

Source§

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

impl PartialOrd for Expr

Source§

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

impl Serialize for Expr

Source§

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

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

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:

Source§

fn span(&self) -> Span

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

impl Visit for Expr

Source§

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

Visit this node with the provided Visitor. Read more
Source§

impl VisitMut for Expr

Source§

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

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

impl Eq for Expr

Source§

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
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> 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
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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,