Skip to main content

Expression

Enum Expression 

Source
pub enum Expression {
Show 32 variants Literal(Value), Variable(String), Property { object: Box<Expression>, property: String, }, StructField { base: Box<Expression>, field: String, }, Binary { left: Box<Expression>, op: BinaryOperator, right: Box<Expression>, }, Unary { op: UnaryOperator, operand: Box<Expression>, }, Function { name: String, args: Vec<FunctionArg>, }, Aggregate { func: AggregateFunctionKind, args: Vec<Expression>, distinct: bool, filter: Option<Box<Expression>>, }, List(Vec<Expression>), Map(Vec<(String, Expression)>), Case { test_expr: Option<Box<Expression>>, conditions: Vec<(Expression, Expression)>, default: Option<Box<Expression>>, }, TypeCast { expression: Box<Expression>, target_type: DataType, }, Subscript { collection: Box<Expression>, index: Box<Expression>, }, Range { collection: Box<Expression>, start: Option<Box<Expression>>, end: Option<Box<Expression>>, }, Path(Vec<Expression>), Label(String), ListComprehension { variable: String, source: Box<Expression>, filter: Option<Box<Expression>>, map: Option<Box<Expression>>, }, LabelTagProperty { tag: Box<Expression>, property: String, }, TagProperty { tag_name: String, property: String, }, EdgeProperty { edge_name: String, property: String, }, Predicate { func: String, args: Vec<Expression>, }, Reduce { accumulator: String, initial: Box<Expression>, variable: String, source: Box<Expression>, mapping: Box<Expression>, }, PathBuild(Vec<Expression>), Parameter(String), SessionVariable(String), Vector(Vec<f32>), WindowFunction { name: String, args: Vec<Expression>, over_partition_by: Vec<Expression>, over_order_by: Vec<Expression>, over_order_desc: Vec<bool>, }, Exists { body: Box<SubqueryBody>, }, In { expr: Box<Expression>, subquery: Box<SubqueryBody>, negated: bool, }, CountSubquery { body: Box<SubqueryBody>, }, ScalarSubquery { body: Box<SubqueryBody>, }, Lambda { params: Vec<String>, body: Box<Expression>, },
}
Expand description

Unified Expression Type

An enumeration of expressions containing location information (span fields) for:

  • Parser layer: error localization and reporting
  • Core Layer: Type Checking and Enforcement
  • Serialization: storage and transmission

Variants§

§

Literal(Value)

literal value

§

Variable(String)

variable reference

§

Property

Property Access

Fields

§object: Box<Expression>
§property: String
§

StructField

STRUCT field access

Accesses a named field of a STRUCT value, e.g. addr.city.

Fields

§field: String
§

Binary

binary operation

§

Unary

one-dimensional operation

Fields

§operand: Box<Expression>
§

Function

function call

Fields

§name: String
§

Aggregate

aggregate function (math.)

§

List(Vec<Expression>)

list literal

§

Map(Vec<(String, Expression)>)

mapping literal

§

Case

conditional expression

Fields

§test_expr: Option<Box<Expression>>
§conditions: Vec<(Expression, Expression)>
§

TypeCast

type conversion

Fields

§expression: Box<Expression>
§target_type: DataType
§

Subscript

subscript access

Fields

§collection: Box<Expression>
§

Range

range expression

Fields

§collection: Box<Expression>
§

Path(Vec<Expression>)

path expression

§

Label(String)

tag expression

§

ListComprehension

List Derivative Expressions

Fields

§variable: String
§source: Box<Expression>
§

LabelTagProperty

Dynamic access to tag attributes

Used to access tag properties dynamically, e.g. tagName.propertyName where tagName is a variable or tag expression

Fields

§property: String
§

TagProperty

Tag Attribute Access

Used to access properties on the vertex tag, e.g. tagName.propertyName

Fields

§tag_name: String
§property: String
§

EdgeProperty

Edge Attribute Access

Used to access attributes on an edge type

Fields

§edge_name: String
§property: String
§

Predicate

predicate expression (math.)

Used to implement predicate functions such as FILTER, ALL, ANY, EXISTS, etc.

Fields

§func: String
§

Reduce

Reduce expression

Used to implement the REDUCE function

Fields

§accumulator: String
§initial: Box<Expression>
§variable: String
§source: Box<Expression>
§mapping: Box<Expression>
§

PathBuild(Vec<Expression>)

path construction expression

Used for building paths, such as path(v1, e1, v2)

§

Parameter(String)

Query parameter expression

Used to represent query parameters, e.g. @param.

§

SessionVariable(String)

Session variable expression

Used to represent session-scoped variables, e.g. $name. Resolved from the session variable snapshot at execution time; distinct from Expression::Parameter so EXPLAIN, type inference and error reporting can tell the two apart.

§

Vector(Vec<f32>)

Vector literal expression

Represents vector literals like VECTOR[0.1, 0.2, 0.3] or [0.1, 0.2]::VECTOR

§

WindowFunction

Window function expression with OVER clause

Fields

§name: String

Window function name (e.g. “row_number”, “rank”, “lead”)

§args: Vec<Expression>

Arguments to the window function

§over_partition_by: Vec<Expression>

PARTITION BY expressions

§over_order_by: Vec<Expression>

ORDER BY expressions

§over_order_desc: Vec<bool>

Whether each ORDER BY expression is descending

§

Exists

EXISTS subquery expression

Evaluates to true if the subquery pattern has at least one match. Syntax: EXISTS { pattern } or EXISTS(pattern)

Fields

§body: Box<SubqueryBody>

The subquery body (WHERE clause condition or pattern reference)

§

In

IN subquery expression

Evaluates to true if expr is in the result set of the subquery. Syntax: expr IN { MATCH ... RETURN ... }

Fields

§expr: Box<Expression>

The expression to test

§subquery: Box<SubqueryBody>

The subquery body

§negated: bool

Whether this is NOT IN

§

CountSubquery

COUNT subquery expression

Evaluates to the number of rows returned by the subquery. Syntax: COUNT { MATCH ... RETURN ... }

Fields

§body: Box<SubqueryBody>

The subquery body

§

ScalarSubquery

Scalar subquery expression

Evaluates to the first column of the first row returned by the subquery, or NULL when the subquery returns no rows. Syntax: SUBQUERY { MATCH ... RETURN <single expr> }

Fields

§body: Box<SubqueryBody>

The subquery body (must carry a single-column return_expr)

§

Lambda

Lambda expression

Represents an anonymous function, e.g. x -> x + 1 or (x, y) -> x + y. Used as callbacks for higher-order list functions like list_transform, list_filter.

Fields

§params: Vec<String>

Parameter names

§body: Box<Expression>

Lambda body expression

Implementations§

Source§

impl Expression

Source

pub fn literal(value: impl Into<Value>) -> Expression

Creating literal expressions

Source

pub fn variable(name: impl Into<String>) -> Expression

Create a variable expression.

Source

pub fn property(object: Expression, property: impl Into<String>) -> Expression

Create attribute access expressions

Source

pub fn struct_field(base: Expression, field: impl Into<String>) -> Expression

Create a STRUCT field access expression.

Source

pub fn binary( left: Expression, op: BinaryOperator, right: Expression, ) -> Expression

Create a binary operation expression

Source

pub fn unary(op: UnaryOperator, operand: Expression) -> Expression

Create a unary operation expression.

Source

pub fn function(name: impl Into<String>, args: Vec<Expression>) -> Expression

Create a function call expression with positional arguments.

Source

pub fn function_with_args( name: impl Into<String>, args: Vec<FunctionArg>, ) -> Expression

Create a function call expression with mixed positional and named arguments.

Source

pub fn aggregate( func: AggregateFunctionKind, arg: Expression, distinct: bool, ) -> Expression

Create an aggregate function expression.

Source

pub fn aggregate_with_filter( func: AggregateFunctionKind, arg: Expression, distinct: bool, filter: Expression, ) -> Expression

Create an aggregate function expression with a FILTER clause.

Source

pub fn aggregate_multi( func: AggregateFunctionKind, args: Vec<Expression>, distinct: bool, ) -> Expression

Create a multi-argument aggregate function expression (e.g. CORR, COVAR).

Source

pub fn list(items: Vec<Expression>) -> Expression

Create a list expression.

Source

pub fn map(pairs: Vec<(impl Into<String>, Expression)>) -> Expression

Create a mapping expression

Source

pub fn case( test_expr: Option<Expression>, conditions: Vec<(Expression, Expression)>, default: Option<Expression>, ) -> Expression

Create a conditional expression

Source

pub fn cast(expression: Expression, target_type: DataType) -> Expression

Create a type conversion expression.

Source

pub fn subscript(collection: Expression, index: Expression) -> Expression

Create an subscript access expression.

Source

pub fn range( collection: Expression, start: Option<Expression>, end: Option<Expression>, ) -> Expression

Create a range expression

Source

pub fn path(items: Vec<Expression>) -> Expression

Create a path expression

Source

pub fn label(name: impl Into<String>) -> Expression

Create a tag expression

Source

pub fn list_comprehension( variable: impl Into<String>, source: Expression, filter: Option<Expression>, map: Option<Expression>, ) -> Expression

Create a list comprehension expression.

Source

pub fn label_tag_property( tag: Expression, property: impl Into<String>, ) -> Expression

Create dynamic access expressions for tag attributes

Source

pub fn tag_property( tag_name: impl Into<String>, property: impl Into<String>, ) -> Expression

Create tag attribute access expressions

Source

pub fn edge_property( edge_name: impl Into<String>, property: impl Into<String>, ) -> Expression

Create an edge attribute access expression.

Source

pub fn predicate(func: impl Into<String>, args: Vec<Expression>) -> Expression

Create a predicate expression.

Source

pub fn reduce( accumulator: impl Into<String>, initial: Expression, variable: impl Into<String>, source: Expression, mapping: Expression, ) -> Expression

Create a Reduce expression.

Source

pub fn path_build(items: Vec<Expression>) -> Expression

Create a path construction expression

Source

pub fn parameter(name: impl Into<String>) -> Expression

Create a parameter expression

Source

pub fn session_variable(name: impl Into<String>) -> Expression

Create a session variable expression

Source

pub fn vector(data: Vec<f32>) -> Expression

Create a vector literal expression

Source

pub fn exists(body: SubqueryBody) -> Expression

Create an EXISTS subquery expression

Source

pub fn in_subquery( expr: Expression, subquery: SubqueryBody, negated: bool, ) -> Expression

Create an IN subquery expression

Source

pub fn count_subquery(body: SubqueryBody) -> Expression

Create a COUNT subquery expression

Source

pub fn scalar_subquery(body: SubqueryBody) -> Expression

Create a scalar subquery expression

Source

pub fn lambda(params: Vec<String>, body: Expression) -> Expression

Create a Lambda expression

Source

pub fn bool(value: bool) -> Expression

Creating a boolean literal

Source

pub fn int(value: i32) -> Expression

Creating integer literal values (i32)

Source

pub fn bigint(value: i64) -> Expression

Creating bigint literal values (i64)

Source

pub fn float(value: f32) -> Expression

Creating a floating-point numeric literal (f32)

Source

pub fn double(value: f64) -> Expression

Creating a double-precision numeric literal (f64)

Source

pub fn string(value: impl AsRef<str>) -> Expression

Creating a string literal

Source

pub fn null() -> Expression

Create an empty literal value.

Source

pub fn modulo(left: Expression, right: Expression) -> Expression

Create a modulus expression

Source

pub fn eq(left: Expression, right: Expression) -> Expression

Creating an expression that equals a certain value…

Source

pub fn ne(left: Expression, right: Expression) -> Expression

Creating something does not equal expressing it in words.

Source

pub fn lt(left: Expression, right: Expression) -> Expression

Create an expression that is smaller than the given one.

Source

pub fn le(left: Expression, right: Expression) -> Expression

Create an expression that is less than or equal to…

Source

pub fn gt(left: Expression, right: Expression) -> Expression

Create something that is greater than the expression…

Source

pub fn ge(left: Expression, right: Expression) -> Expression

Create an expression that is greater than or equal to…

Source

pub fn and(left: Expression, right: Expression) -> Expression

Creating logic and expressions

Source

pub fn or(left: Expression, right: Expression) -> Expression

Create a logical statement or expression.

Source

pub fn is_null(operand: Expression) -> Expression

Creating an IS NULL expression

Source

pub fn is_not_null(operand: Expression) -> Expression

Creating an IS NOT NULL expression

Source§

impl Expression

Source

pub fn to_expression_string(&self) -> String

Convert the expression into a string representation.

Generate an expression string similar to SQL/Cypher.

Source§

impl Expression

Source

pub fn is_constant(&self) -> bool

Checking if an expression is a constant

Constant expressions can be determined at compile time and do not require run-time evaluation.

Source

pub fn contains_aggregate(&self) -> bool

Check if the expression contains an aggregate function

Used to identify expressions that need to be evaluated in a GROUP BY context.

Source

pub fn get_variables(&self) -> Vec<String>

Get the names of all variables in the expression

Returns a list of de-duplicated variable names.

Source

pub fn is_literal(&self) -> bool

Checks if it is a literal expression

Source

pub fn as_literal(&self) -> Option<&Value>

Get the literal value (if it is a literal)

Source

pub fn is_variable(&self) -> bool

Checking for variable expressions

Source

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

Get variable name (if variable)

Source

pub fn is_aggregate(&self) -> bool

Checking for Aggregate Expressions

Source

pub fn is_property(&self) -> bool

Checks if it is an attribute access expression

Source

pub fn is_function(&self) -> bool

Check if it is a function call expression

Source

pub fn is_binary(&self) -> bool

Checking for binary arithmetic expressions

Source

pub fn is_unary(&self) -> bool

Checking for unary arithmetic expressions

Source

pub fn is_list(&self) -> bool

Checks if it is a list expression

Source

pub fn is_map(&self) -> bool

Checks if it is a mapping expression

Source

pub fn is_path(&self) -> bool

Checks if it is a path expression

Source

pub fn is_label(&self) -> bool

Checks if it’s a tag expression

Source

pub fn is_parameter(&self) -> bool

Checks if it is a parameter expression

Source

pub fn is_session_variable(&self) -> bool

Checks if it is a session variable expression

Source

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

Get the parameter name (if it is a parameter)

Source

pub fn is_case(&self) -> bool

Checking for Conditional Expressions

Source

pub fn is_cast(&self) -> bool

Checking for type conversion expressions

Source

pub fn is_subscript(&self) -> bool

Checking for subscript access expressions

Source

pub fn is_range(&self) -> bool

Checks if it is a range expression

Source

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

Get the function name (if it’s a function call)

Source

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

Get the name of the aggregate function (if it is an aggregate expression)

Source

pub fn is_path_build(&self) -> bool

Checks if it is a path building expression

Source

pub fn is_type_cast(&self) -> bool

Check whether it is a type conversion expression

Source

pub fn is_list_comprehension(&self) -> bool

Checking for List Derivation Expressions

Source

pub fn is_reduce(&self) -> bool

Checks for a Reduce expression

Source

pub fn is_count_subquery(&self) -> bool

Checks for a COUNT subquery expression

Source

pub fn is_scalar_subquery(&self) -> bool

Checks for a scalar subquery expression

Source

pub fn is_lambda(&self) -> bool

Checks for a Lambda expression

Source

pub fn as_function_name(&self) -> Option<String>

Gets the function name (if it is a function call)

Source

pub fn as_property_name(&self) -> Option<String>

Get the attribute name (in case of attribute access)

Source

pub fn as_label_name(&self) -> Option<String>

Get the tag name (if it’s a tag expression)

Source

pub fn as_parameter_name(&self) -> Option<String>

Get the parameter name (if it is a parameter expression)

Source

pub fn as_session_variable_name(&self) -> Option<String>

Get the session variable name (if it is a session variable expression)

Source§

impl Expression

Source

pub fn estimate_memory_iterative(&self) -> usize

Estimate memory using iterative approach to avoid stack overflow This is useful for deeply nested expressions

Source

pub fn is_simple(&self) -> bool

Check if this is a simple expression (leaf node)

Source

pub fn node_count(&self) -> usize

Get approximate node count for complexity estimation

Source§

impl Expression

Source

pub fn children(&self) -> Vec<&Expression>

Obtain all the subexpressions of the expression.

Return a vector that contains all the direct subexpressions.

Source

pub fn children_mut(&mut self) -> Vec<&mut Expression>

Obtaining the variable subexpression

Return a vector containing all the directly mutable subexpressions.

Source

pub fn traverse_preorder<F>(&self, callback: &mut F)
where F: FnMut(&Expression),

Traversing the expression tree (pre-order traversal)

Perform a pre-order traversal of the expression tree, and call the callback function for each node.

Source

pub fn traverse_postorder<F>(&self, callback: &mut F)
where F: FnMut(&Expression),

Traversing the expression tree (post-order traversal)

Perform a post-order traversal of the expression tree, and call the callback function for each node.

Source

pub fn find<F>(&self, predicate: &F) -> Option<&Expression>
where F: Fn(&Expression) -> bool,

Find the expression that meets the conditions.

Find the first expression in the expression tree that meets the specified condition.

Source

pub fn find_all<'a, F>( &'a self, predicate: &F, results: &mut Vec<&'a Expression>, )
where F: Fn(&Expression) -> bool,

Find all expressions that meet the specified conditions.

Find all expressions in the expression tree that meet the specified conditions.

Source

pub fn transform<F>(&self, transformer: &F) -> Expression
where F: Fn(&Expression) -> Option<Expression>,

Transform the expression tree

Transform the expression tree and return the new expression tree.

Source§

impl Expression

Source

pub fn deduce_type(&self) -> DataType

Deriving the data type of an expression

Derive the return type of an expression from its structure and operators. Returns DataType::Unknown if the type cannot be determined without schema/binding information (the binder completes these paths), and DataType::Empty only for the explicit Value::Empty.

Trait Implementations§

Source§

impl Add for Expression

Source§

type Output = Expression

The resulting type after applying the + operator.
Source§

fn add(self, rhs: Expression) -> <Expression as Add>::Output

Performs the + operation. Read more
Source§

impl Clone for Expression

Source§

fn clone(&self) -> Expression

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for Expression

Source§

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

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

impl<'de> Deserialize<'de> for Expression

Source§

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

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

impl Display for Expression

Source§

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

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

impl Div for Expression

Source§

type Output = Expression

The resulting type after applying the / operator.
Source§

fn div(self, rhs: Expression) -> <Expression as Div>::Output

Performs the / operation. Read more
Source§

impl From<Arc<ExpressionMeta>> for Expression

Extract the core expressions from Arc ExpressionMeta.

Source§

fn from(meta: Arc<ExpressionMeta>) -> Expression

Converts to this type from the input type.
Source§

impl From<ExpressionMeta> for Expression

Extract the core expressions from ExpressionMeta.

Source§

fn from(meta: ExpressionMeta) -> Expression

Converts to this type from the input type.
Source§

impl MemoryEstimatable for Expression

Source§

impl Mul for Expression

Source§

type Output = Expression

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Expression) -> <Expression as Mul>::Output

Performs the * operation. Read more
Source§

impl Neg for Expression

Source§

type Output = Expression

The resulting type after applying the - operator.
Source§

fn neg(self) -> <Expression as Neg>::Output

Performs the unary - operation. Read more
Source§

impl Not for Expression

Source§

type Output = Expression

The resulting type after applying the ! operator.
Source§

fn not(self) -> <Expression as Not>::Output

Performs the unary ! operation. Read more
Source§

impl PartialEq for Expression

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl Serialize for Expression

Source§

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

impl StructuralPartialEq for Expression

Source§

impl Sub for Expression

Source§

type Output = Expression

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: Expression) -> <Expression as Sub>::Output

Performs the - operation. Read more

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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> Conv for T

Source§

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

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

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

Source§

impl<T> FmtForward for T

Source§

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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.

Source§

impl<T> Instrument for T

Source§

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

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

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

Source§

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

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

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

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

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

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

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

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

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

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

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

Initializes a with the given initializer. Read more
Source§

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

Dereferences the given pointer. Read more
Source§

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

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

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

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> Tap for T

Source§

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

Immutable access to a value. Read more
Source§

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

Mutable access to a value. Read more
Source§

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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> ToCompactString for T
where T: Display,

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> TryConv for T

Source§

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 = !

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

fn try_from(value: U) -> Result<T, !>

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<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

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

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

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