Enum mz_sql::plan::HirScalarExpr
source · pub enum HirScalarExpr {
Column(ColumnRef),
Parameter(usize),
Literal(Row, ColumnType),
CallUnmaterializable(UnmaterializableFunc),
CallUnary {
func: UnaryFunc,
expr: Box<HirScalarExpr>,
},
CallBinary {
func: BinaryFunc,
expr1: Box<HirScalarExpr>,
expr2: Box<HirScalarExpr>,
},
CallVariadic {
func: VariadicFunc,
exprs: Vec<HirScalarExpr>,
},
If {
cond: Box<HirScalarExpr>,
then: Box<HirScalarExpr>,
els: Box<HirScalarExpr>,
},
Exists(Box<HirRelationExpr>),
Select(Box<HirRelationExpr>),
Windowing(WindowExpr),
}
Expand description
Just like mz_expr::MirScalarExpr
, except where otherwise noted below.
Variants§
Column(ColumnRef)
Unlike mz_expr::MirScalarExpr, we can nest HirRelationExprs via eg Exists. This means that a variable could refer to a column of the current input, or to a column of an outer relation. We use ColumnRef to denote the difference.
Parameter(usize)
Literal(Row, ColumnType)
CallUnmaterializable(UnmaterializableFunc)
CallUnary
CallBinary
CallVariadic
If
Exists(Box<HirRelationExpr>)
Returns true if expr
returns any rows
Select(Box<HirRelationExpr>)
Given expr
with arity 1. If expr returns:
- 0 rows, return NULL
- 1 row, return the value of that row
-
1 rows, the sql spec says we should throw an error but we can’t (see https://github.com/MaterializeInc/database-issues/issues/154) so instead we return all the rows. If there are multiple
Select
expressions in a single SQL query, the result is that we take the product of all of them. This is counter to the spec, but is consistent with eg postgres’ treatment of multiple set-returning-functions (see https://tapoueh.org/blog/2017/10/set-returning-functions-and-postgresql-10/).
Windowing(WindowExpr)
Implementations§
source§impl HirScalarExpr
impl HirScalarExpr
sourcepub fn bind_parameters(&mut self, params: &Params) -> Result<(), PlanError>
pub fn bind_parameters(&mut self, params: &Params) -> Result<(), PlanError>
Replaces any parameter references in the expression with the
corresponding datum in params
.
sourcepub fn splice_parameters(&mut self, params: &[HirScalarExpr], depth: usize)
pub fn splice_parameters(&mut self, params: &[HirScalarExpr], depth: usize)
Like HirScalarExpr::bind_parameters
, except that parameters are
replaced with the corresponding expression fragment from params
rather
than a datum.
Specifically, the parameter $1
will be replaced with params[0]
, the
parameter $2
will be replaced with params[1]
, and so on. Parameters
in self
that refer to invalid indices of params
will cause a panic.
Column references in parameters will be corrected to account for the depth at which they are spliced.
sourcepub fn contains_temporal(&self) -> bool
pub fn contains_temporal(&self) -> bool
Whether the expression contains an UnmaterializableFunc::MzNow
call.
sourcepub fn column(index: usize) -> HirScalarExpr
pub fn column(index: usize) -> HirScalarExpr
Constructs a column reference in the current scope.
pub fn literal(datum: Datum<'_>, scalar_type: ScalarType) -> HirScalarExpr
pub fn literal_true() -> HirScalarExpr
pub fn literal_false() -> HirScalarExpr
pub fn literal_null(scalar_type: ScalarType) -> HirScalarExpr
pub fn literal_1d_array( datums: Vec<Datum<'_>>, element_scalar_type: ScalarType, ) -> Result<HirScalarExpr, PlanError>
pub fn as_literal(&self) -> Option<Datum<'_>>
pub fn is_literal_true(&self) -> bool
pub fn is_literal_false(&self) -> bool
pub fn is_literal_null(&self) -> bool
sourcepub fn is_constant(&self) -> bool
pub fn is_constant(&self) -> bool
Return true iff self
consists only of constants, function calls, and
if-else statements.
pub fn call_unary(self, func: UnaryFunc) -> Self
pub fn call_binary(self, other: Self, func: BinaryFunc) -> Self
pub fn or(self, other: Self) -> Self
pub fn and(self, other: Self) -> Self
pub fn not(self) -> Self
pub fn call_is_null(self) -> Self
sourcepub fn variadic_and(args: Vec<HirScalarExpr>) -> HirScalarExpr
pub fn variadic_and(args: Vec<HirScalarExpr>) -> HirScalarExpr
Calls AND with the given arguments. Simplifies if 0 or 1 args.
sourcepub fn variadic_or(args: Vec<HirScalarExpr>) -> HirScalarExpr
pub fn variadic_or(args: Vec<HirScalarExpr>) -> HirScalarExpr
Calls OR with the given arguments. Simplifies if 0 or 1 args.
pub fn take(&mut self) -> Self
pub fn visit<'a, F>(&'a self, f: &mut F)
pub fn visit1<'a, F>(&'a self, f: F)
pub fn visit_mut<F>(&mut self, f: &mut F)
Visit::visit_post
instead.pub fn visit_mut_pre<F>(&mut self, f: &mut F)
Visit::visit_mut_pre
instead.pub fn visit1_mut<F>(&mut self, f: F)
VisitChildren<HirScalarExpr>::visit_children
instead.sourcepub fn visit_pre_post<F1, F2>(&self, pre: &mut F1, post: &mut F2)
👎Deprecated: Use Visit::visit_pre_post
instead.
pub fn visit_pre_post<F1, F2>(&self, pre: &mut F1, post: &mut F2)
Visit::visit_pre_post
instead.A generalization of visit
. The function pre
runs on a
HirScalarExpr
before it runs on any of the child HirScalarExpr
s.
The function post
runs on child HirScalarExpr
s first before the
parent. Optionally, pre
can return which child HirScalarExpr
s, if
any, should be visited (default is to visit all children).
sourcepub fn visit_columns<F>(&self, depth: usize, f: &mut F)
👎Deprecated: Redefine this based on the Visit
and VisitChildren
methods.
pub fn visit_columns<F>(&self, depth: usize, f: &mut F)
Visit
and VisitChildren
methods.Visits the column references in this scalar expression.
The depth
argument should indicate the subquery nesting depth of the expression,
which will be incremented with each subquery entered and presented to the supplied
function f
.
sourcepub fn visit_columns_mut<F>(&mut self, depth: usize, f: &mut F)
👎Deprecated: Redefine this based on the Visit
and VisitChildren
methods.
pub fn visit_columns_mut<F>(&mut self, depth: usize, f: &mut F)
Visit
and VisitChildren
methods.Like visit_columns
, but permits mutating the column references.
sourcepub fn visit_columns_referring_to_root_level<F>(&self, f: &mut F)
pub fn visit_columns_referring_to_root_level<F>(&self, f: &mut F)
Visits those column references in this scalar expression that refer to the root
level. These include column references that are at the root level, as well as column
references that are at a deeper subquery nesting depth, but refer back to the root level.
(Note that even if self
is embedded inside a larger expression, we consider the
“root level” to be self
’s level.)
sourcepub fn visit_columns_referring_to_root_level_mut<F>(&mut self, f: &mut F)
pub fn visit_columns_referring_to_root_level_mut<F>(&mut self, f: &mut F)
Like visit_columns_referring_to_root_level
, but permits mutating the column references.
sourcepub fn visit_recursively<F, E>(&self, depth: usize, f: &mut F) -> Result<(), E>
👎Deprecated: Redefine this based on the Visit
and VisitChildren
methods.
pub fn visit_recursively<F, E>(&self, depth: usize, f: &mut F) -> Result<(), E>
Visit
and VisitChildren
methods.Like visit
but it enters the subqueries visiting the scalar expressions contained
in them. It takes the current depth of the expression and increases it when
entering a subquery.
sourcepub fn visit_recursively_mut<F, E>(
&mut self,
depth: usize,
f: &mut F,
) -> Result<(), E>
👎Deprecated: Redefine this based on the Visit
and VisitChildren
methods.
pub fn visit_recursively_mut<F, E>( &mut self, depth: usize, f: &mut F, ) -> Result<(), E>
Visit
and VisitChildren
methods.Like visit_recursively
, but permits mutating the scalar expressions.
fn simplify_to_literal(self) -> Option<Row>
sourcepub fn into_literal_int64(self) -> Option<i64>
pub fn into_literal_int64(self) -> Option<i64>
Attempts to simplify this expression to a literal 64-bit integer.
Returns None
if this expression cannot be simplified, e.g. because it
contains non-literal values.
§Panics
Panics if this expression does not have type ScalarType::Int64
.
sourcepub fn into_literal_string(self) -> Option<String>
pub fn into_literal_string(self) -> Option<String>
Attempts to simplify this expression to a literal string.
Returns None
if this expression cannot be simplified, e.g. because it
contains non-literal values.
§Panics
Panics if this expression does not have type ScalarType::String
.
sourcepub fn into_literal_mz_timestamp(self) -> Option<Timestamp>
pub fn into_literal_mz_timestamp(self) -> Option<Timestamp>
Attempts to simplify this expression to a literal MzTimestamp.
Returns None
if this expression cannot be simplified, e.g. because it
contains non-literal values.
TODO: Make this (and the other similar fns above) return Result, so that we can show the error when it fails. (E.g., there can be non-trivial cast errors.)
§Panics
Panics if this expression does not have type ScalarType::MzTimestamp
.
source§impl HirScalarExpr
impl HirScalarExpr
sourcefn applied_to(
self,
id_gen: &mut IdGen,
col_map: &ColumnMap,
cte_map: &mut BTreeMap<LocalId, CteDesc>,
inner: &mut MirRelationExpr,
subquery_map: &Option<&BTreeMap<HirScalarExpr, usize>>,
context: &Context<'_>,
) -> Result<MirScalarExpr, PlanError>
fn applied_to( self, id_gen: &mut IdGen, col_map: &ColumnMap, cte_map: &mut BTreeMap<LocalId, CteDesc>, inner: &mut MirRelationExpr, subquery_map: &Option<&BTreeMap<HirScalarExpr, usize>>, context: &Context<'_>, ) -> Result<MirScalarExpr, PlanError>
Rewrite self
into a mz_expr::ScalarExpr
which can be applied to the modified inner
.
This method is responsible for decorrelating subqueries in self
by introducing further columns
to inner
, and rewriting self
to refer to its physical columns (specified by usize
positions).
The most complicated logic is for the scalar expressions that involve subqueries, each of which are
documented in more detail closer to their logic.
This process presumes that inner
is the result of decorrelation, meaning its first several columns
may be inherited from outer relations. The col_map
column map should provide specific offsets where
each of these references can be found.
fn window_func_applied_to<F>(
id_gen: &mut IdGen,
col_map: &ColumnMap,
cte_map: &mut BTreeMap<LocalId, CteDesc>,
inner: &mut MirRelationExpr,
subquery_map: &Option<&BTreeMap<HirScalarExpr, usize>>,
partition_by: Vec<HirScalarExpr>,
order_by: Vec<HirScalarExpr>,
mir_aggr_func: AggregateFunc,
lower_args: F,
context: &Context<'_>,
) -> Result<MirScalarExpr, PlanError>where
F: FnOnce(&mut IdGen, &ColumnMap, &mut BTreeMap<LocalId, CteDesc>, &mut MirRelationExpr, &Option<&BTreeMap<HirScalarExpr, usize>>, Vec<MirScalarExpr>, MirScalarExpr, ScalarType) -> Result<(MirScalarExpr, ColumnType), PlanError>,
sourcefn lower_subqueries(
exprs: &[Self],
id_gen: &mut IdGen,
col_map: &ColumnMap,
cte_map: &mut BTreeMap<LocalId, CteDesc>,
inner: MirRelationExpr,
context: &Context<'_>,
) -> Result<(MirRelationExpr, BTreeMap<HirScalarExpr, usize>), PlanError>
fn lower_subqueries( exprs: &[Self], id_gen: &mut IdGen, col_map: &ColumnMap, cte_map: &mut BTreeMap<LocalId, CteDesc>, inner: MirRelationExpr, context: &Context<'_>, ) -> Result<(MirRelationExpr, BTreeMap<HirScalarExpr, usize>), PlanError>
Applies the subqueries in the given list of scalar expressions to every distinct value of the given relation and returns a join of the given relation with all the subqueries found, and the mapping of scalar expressions with columns projected by the returned join that will hold their results.
Rewrites self
into a mz_expr::ScalarExpr
.
Trait Implementations§
source§impl AbstractExpr for HirScalarExpr
impl AbstractExpr for HirScalarExpr
type Type = ColumnType
source§fn typ(
&self,
outers: &[RelationType],
inner: &RelationType,
params: &BTreeMap<usize, ScalarType>,
) -> Self::Type
fn typ( &self, outers: &[RelationType], inner: &RelationType, params: &BTreeMap<usize, ScalarType>, ) -> Self::Type
source§impl Clone for HirScalarExpr
impl Clone for HirScalarExpr
source§fn clone(&self) -> HirScalarExpr
fn clone(&self) -> HirScalarExpr
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for HirScalarExpr
impl Debug for HirScalarExpr
source§impl<'de> Deserialize<'de> for HirScalarExpr
impl<'de> Deserialize<'de> for HirScalarExpr
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
source§impl Display for HirScalarExpr
impl Display for HirScalarExpr
source§impl From<HirScalarExpr> for CoercibleScalarExpr
impl From<HirScalarExpr> for CoercibleScalarExpr
source§fn from(expr: HirScalarExpr) -> CoercibleScalarExpr
fn from(expr: HirScalarExpr) -> CoercibleScalarExpr
source§impl Hash for HirScalarExpr
impl Hash for HirScalarExpr
source§impl Ord for HirScalarExpr
impl Ord for HirScalarExpr
source§fn cmp(&self, other: &HirScalarExpr) -> Ordering
fn cmp(&self, other: &HirScalarExpr) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
source§impl PartialEq for HirScalarExpr
impl PartialEq for HirScalarExpr
source§impl PartialOrd for HirScalarExpr
impl PartialOrd for HirScalarExpr
source§impl ScalarOps for HirScalarExpr
impl ScalarOps for HirScalarExpr
fn match_col_ref(&self) -> Option<usize>
fn references(&self, column: usize) -> bool
source§impl Serialize for HirScalarExpr
impl Serialize for HirScalarExpr
source§impl VisitChildren<HirScalarExpr> for AggregateWindowExpr
impl VisitChildren<HirScalarExpr> for AggregateWindowExpr
source§fn visit_children<F>(&self, f: F)where
F: FnMut(&HirScalarExpr),
fn visit_children<F>(&self, f: F)where
F: FnMut(&HirScalarExpr),
f
to each direct child.source§fn visit_mut_children<F>(&mut self, f: F)where
F: FnMut(&mut HirScalarExpr),
fn visit_mut_children<F>(&mut self, f: F)where
F: FnMut(&mut HirScalarExpr),
f
to each direct child.source§fn try_visit_children<F, E>(&self, f: F) -> Result<(), E>
fn try_visit_children<F, E>(&self, f: F) -> Result<(), E>
f
to each direct child. Read moresource§impl VisitChildren<HirScalarExpr> for HirRelationExpr
impl VisitChildren<HirScalarExpr> for HirRelationExpr
source§fn visit_children<F>(&self, f: F)where
F: FnMut(&HirScalarExpr),
fn visit_children<F>(&self, f: F)where
F: FnMut(&HirScalarExpr),
f
to each direct child.source§fn visit_mut_children<F>(&mut self, f: F)where
F: FnMut(&mut HirScalarExpr),
fn visit_mut_children<F>(&mut self, f: F)where
F: FnMut(&mut HirScalarExpr),
f
to each direct child.source§fn try_visit_children<F, E>(&self, f: F) -> Result<(), E>
fn try_visit_children<F, E>(&self, f: F) -> Result<(), E>
f
to each direct child. Read moresource§impl VisitChildren<HirScalarExpr> for HirScalarExpr
impl VisitChildren<HirScalarExpr> for HirScalarExpr
source§fn visit_children<F>(&self, f: F)
fn visit_children<F>(&self, f: F)
f
to each direct child.source§fn visit_mut_children<F>(&mut self, f: F)
fn visit_mut_children<F>(&mut self, f: F)
f
to each direct child.source§impl VisitChildren<HirScalarExpr> for ValueWindowExpr
impl VisitChildren<HirScalarExpr> for ValueWindowExpr
source§fn visit_children<F>(&self, f: F)where
F: FnMut(&HirScalarExpr),
fn visit_children<F>(&self, f: F)where
F: FnMut(&HirScalarExpr),
f
to each direct child.source§fn visit_mut_children<F>(&mut self, f: F)where
F: FnMut(&mut HirScalarExpr),
fn visit_mut_children<F>(&mut self, f: F)where
F: FnMut(&mut HirScalarExpr),
f
to each direct child.source§fn try_visit_children<F, E>(&self, f: F) -> Result<(), E>
fn try_visit_children<F, E>(&self, f: F) -> Result<(), E>
f
to each direct child. Read moresource§impl VisitChildren<HirScalarExpr> for WindowExpr
impl VisitChildren<HirScalarExpr> for WindowExpr
source§fn visit_children<F>(&self, f: F)where
F: FnMut(&HirScalarExpr),
fn visit_children<F>(&self, f: F)where
F: FnMut(&HirScalarExpr),
f
to each direct child.source§fn visit_mut_children<F>(&mut self, f: F)where
F: FnMut(&mut HirScalarExpr),
fn visit_mut_children<F>(&mut self, f: F)where
F: FnMut(&mut HirScalarExpr),
f
to each direct child.source§fn try_visit_children<F, E>(&self, f: F) -> Result<(), E>
fn try_visit_children<F, E>(&self, f: F) -> Result<(), E>
f
to each direct child. Read moresource§impl VisitChildren<HirScalarExpr> for WindowExprType
impl VisitChildren<HirScalarExpr> for WindowExprType
source§fn visit_children<F>(&self, f: F)where
F: FnMut(&HirScalarExpr),
fn visit_children<F>(&self, f: F)where
F: FnMut(&HirScalarExpr),
f
to each direct child.source§fn visit_mut_children<F>(&mut self, f: F)where
F: FnMut(&mut HirScalarExpr),
fn visit_mut_children<F>(&mut self, f: F)where
F: FnMut(&mut HirScalarExpr),
f
to each direct child.source§fn try_visit_children<F, E>(&self, f: F) -> Result<(), E>
fn try_visit_children<F, E>(&self, f: F) -> Result<(), E>
f
to each direct child. Read moreimpl Eq for HirScalarExpr
impl StructuralPartialEq for HirScalarExpr
Auto Trait Implementations§
impl Freeze for HirScalarExpr
impl RefUnwindSafe for HirScalarExpr
impl Send for HirScalarExpr
impl Sync for HirScalarExpr
impl Unpin for HirScalarExpr
impl UnwindSafe for HirScalarExpr
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<T> FmtForward for T
impl<T> FmtForward for T
source§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self
to use its Binary
implementation when Debug
-formatted.source§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self
to use its Display
implementation when
Debug
-formatted.source§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self
to use its LowerExp
implementation when
Debug
-formatted.source§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self
to use its LowerHex
implementation when
Debug
-formatted.source§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self
to use its Octal
implementation when Debug
-formatted.source§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self
to use its Pointer
implementation when
Debug
-formatted.source§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self
to use its UpperExp
implementation when
Debug
-formatted.source§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self
to use its UpperHex
implementation when
Debug
-formatted.source§impl<T> FutureExt for T
impl<T> FutureExt for T
source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request
source§impl<T, U> OverrideFrom<Option<&T>> for Uwhere
U: OverrideFrom<T>,
impl<T, U> OverrideFrom<Option<&T>> for Uwhere
U: OverrideFrom<T>,
source§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self
and passes that borrow into the pipe function. Read moresource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self
and passes that borrow into the pipe function. Read moresource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
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
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
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
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self
, then passes self.deref()
into the pipe function.source§impl<T> Pointable for T
impl<T> Pointable for T
source§impl<T> PreferredContainer for T
impl<T> PreferredContainer for T
source§impl<T> ProgressEventTimestamp for T
impl<T> ProgressEventTimestamp for T
source§impl<P, R> ProtoType<R> for Pwhere
R: RustType<P>,
impl<P, R> ProtoType<R> for Pwhere
R: RustType<P>,
source§fn into_rust(self) -> Result<R, TryFromProtoError>
fn into_rust(self) -> Result<R, TryFromProtoError>
RustType::from_proto
.source§fn from_rust(rust: &R) -> P
fn from_rust(rust: &R) -> P
RustType::into_proto
.source§impl<'a, S, T> Semigroup<&'a S> for Twhere
T: Semigroup<S>,
impl<'a, S, T> Semigroup<&'a S> for Twhere
T: Semigroup<S>,
source§fn plus_equals(&mut self, rhs: &&'a S)
fn plus_equals(&mut self, rhs: &&'a S)
std::ops::AddAssign
, for types that do not implement AddAssign
.source§impl<T> Serialize for T
impl<T> Serialize for T
fn erased_serialize(&self, serializer: &mut dyn Serializer) -> Result<Ok, Error>
source§impl<T> Tap for T
impl<T> Tap for T
source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B>
of a value. Read moresource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B>
of a value. Read moresource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R>
view of a value. Read moresource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R>
view of a value. Read moresource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target
of a value. Read moresource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target
of a value. Read moresource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap()
only in debug builds, and is erased in release builds.source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut()
only in debug builds, and is erased in release
builds.source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.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
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.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
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.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
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.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
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref()
only in debug builds, and is erased in release
builds.source§impl<T> Visit for Twhere
T: VisitChildren<T>,
impl<T> Visit for Twhere
T: VisitChildren<T>,
source§fn visit_post<F>(&self, f: &mut F) -> Result<(), RecursionLimitError>
fn visit_post<F>(&self, f: &mut F) -> Result<(), RecursionLimitError>
self
.source§fn visit_post_nolimit<F>(&self, f: &mut F)
fn visit_post_nolimit<F>(&self, f: &mut F)
visit_post
instead.self
.
Does not enforce a recursion limit.source§fn visit_mut_post<F>(&mut self, f: &mut F) -> Result<(), RecursionLimitError>
fn visit_mut_post<F>(&mut self, f: &mut F) -> Result<(), RecursionLimitError>
self
.source§fn visit_mut_post_nolimit<F>(&mut self, f: &mut F)
fn visit_mut_post_nolimit<F>(&mut self, f: &mut F)
visit_mut_post
instead.self
.
Does not enforce a recursion limit.source§fn try_visit_post<F, E>(&self, f: &mut F) -> Result<(), E>
fn try_visit_post<F, E>(&self, f: &mut F) -> Result<(), E>
self
.source§fn try_visit_mut_post<F, E>(&mut self, f: &mut F) -> Result<(), E>
fn try_visit_mut_post<F, E>(&mut self, f: &mut F) -> Result<(), E>
self
.source§fn visit_pre<F>(&self, f: &mut F) -> Result<(), RecursionLimitError>
fn visit_pre<F>(&self, f: &mut F) -> Result<(), RecursionLimitError>
self
.source§fn visit_pre_with_context<Context, AccFun, Visitor>(
&self,
init: Context,
acc_fun: &mut AccFun,
visitor: &mut Visitor,
) -> Result<(), RecursionLimitError>
fn visit_pre_with_context<Context, AccFun, Visitor>( &self, init: Context, acc_fun: &mut AccFun, visitor: &mut Visitor, ) -> Result<(), RecursionLimitError>
self
, which also accumulates context
information along the path from the root to the current node’s parent.
acc_fun
is a similar closure as in fold
. The accumulated context is passed to the
visitor, along with the current node. Read moresource§fn visit_pre_nolimit<F>(&self, f: &mut F)
fn visit_pre_nolimit<F>(&self, f: &mut F)
visit_pre
instead.self
.
Does not enforce a recursion limit.source§fn visit_mut_pre<F>(&mut self, f: &mut F) -> Result<(), RecursionLimitError>
fn visit_mut_pre<F>(&mut self, f: &mut F) -> Result<(), RecursionLimitError>
self
.source§fn visit_mut_pre_nolimit<F>(&mut self, f: &mut F)
fn visit_mut_pre_nolimit<F>(&mut self, f: &mut F)
visit_mut_pre
instead.self
.
Does not enforce a recursion limit.source§fn try_visit_pre<F, E>(&self, f: &mut F) -> Result<(), E>
fn try_visit_pre<F, E>(&self, f: &mut F) -> Result<(), E>
self
.source§fn try_visit_mut_pre<F, E>(&mut self, f: &mut F) -> Result<(), E>
fn try_visit_mut_pre<F, E>(&mut self, f: &mut F) -> Result<(), E>
self
.source§fn visit_pre_post<F1, F2>(
&self,
pre: &mut F1,
post: &mut F2,
) -> Result<(), RecursionLimitError>
fn visit_pre_post<F1, F2>( &self, pre: &mut F1, post: &mut F2, ) -> Result<(), RecursionLimitError>
source§fn visit_pre_post_nolimit<F1, F2>(&self, pre: &mut F1, post: &mut F2)
fn visit_pre_post_nolimit<F1, F2>(&self, pre: &mut F1, post: &mut F2)
visit
instead.Visit::visit_pre
and Visit::visit_post
.
Does not enforce a recursion limit. Read moresource§fn visit_mut_pre_post<F1, F2>(
&mut self,
pre: &mut F1,
post: &mut F2,
) -> Result<(), RecursionLimitError>
fn visit_mut_pre_post<F1, F2>( &mut self, pre: &mut F1, post: &mut F2, ) -> Result<(), RecursionLimitError>
visit_mut
instead.source§fn visit_mut_pre_post_nolimit<F1, F2>(&mut self, pre: &mut F1, post: &mut F2)
fn visit_mut_pre_post_nolimit<F1, F2>(&mut self, pre: &mut F1, post: &mut F2)
visit_mut_pre_post
instead.Visit::visit_mut_pre
and Visit::visit_mut_post
.
Does not enforce a recursion limit. Read more