Struct mz_expr::MapFilterProject

source ·
pub struct MapFilterProject {
    pub expressions: Vec<MirScalarExpr>,
    pub predicates: Vec<(usize, MirScalarExpr)>,
    pub projection: Vec<usize>,
    pub input_arity: usize,
}
Expand description

A compound operator that can be applied row-by-row.

This operator integrates the map, filter, and project operators. It applies a sequences of map expressions, which are allowed to refer to previous expressions, interleaved with predicates which must be satisfied for an output to be produced. If all predicates evaluate to Datum::True the data at the identified columns are collected and produced as output in a packed Row.

This operator is a “builder” and its contents may contain expressions that are not yet executable. For example, it may contain temporal expressions in self.expressions, even though this is not something we can directly evaluate. The plan creation methods will defensively ensure that the right thing happens.

Fields§

§expressions: Vec<MirScalarExpr>

A sequence of expressions that should be appended to the row.

Many of these expressions may not be produced in the output, and may only be present as common subexpressions.

§predicates: Vec<(usize, MirScalarExpr)>

Expressions that must evaluate to Datum::True for the output row to be produced.

Each entry is prepended with a column identifier indicating the column before which the predicate should first be applied. Most commonly this would be one plus the largest column identifier in the predicate’s support, but it could be larger to implement guarded evaluation of predicates.

This list should be sorted by the first field.

§projection: Vec<usize>

A sequence of column identifiers whose data form the output row.

§input_arity: usize

The expected number of input columns.

This is needed to ensure correct identification of newly formed columns in the output.

Implementations§

source§

impl MapFilterProject

source

pub fn new(input_arity: usize) -> Self

Create a no-op operator for an input of a supplied arity.

source

pub fn compose(before: Self, after: Self) -> Self

Given two mfps, return an mfp that applies one followed by the other. Note that the arguments are in the opposite order from how function composition is usually written in mathematics.

source

pub fn is_identity(&self) -> bool

True if the operator describes the identity transformation.

source

pub fn project<I>(self, columns: I) -> Self
where I: IntoIterator<Item = usize> + Debug,

Retain only the indicated columns in the presented order.

source

pub fn filter<I>(self, predicates: I) -> Self
where I: IntoIterator<Item = MirScalarExpr>,

Retain only rows satisfying these predicates.

This method introduces predicates as eagerly as they can be evaluated, which may not be desired for predicates that may cause exceptions. If fine manipulation is required, the predicates can be added manually.

source

pub fn map<I>(self, expressions: I) -> Self
where I: IntoIterator<Item = MirScalarExpr>,

Append the result of evaluating expressions to each row.

source

pub fn into_map_filter_project( self, ) -> (Vec<MirScalarExpr>, Vec<MirScalarExpr>, Vec<usize>)

Like MapFilterProject::as_map_filter_project, but consumes self rather than cloning.

source

pub fn as_map_filter_project( &self, ) -> (Vec<MirScalarExpr>, Vec<MirScalarExpr>, Vec<usize>)

As the arguments to Map, Filter, and Project operators.

In principle, this operator can be implemented as a sequence of more elemental operators, likely less efficiently.

source

pub fn literal_constraint(&self, expr: &MirScalarExpr) -> Option<Datum<'_>>

Determines if a scalar expression must be equal to a literal datum.

source

pub fn literal_constraints(&self, exprs: &[MirScalarExpr]) -> Option<Row>

Determines if a sequence of scalar expressions must be equal to a literal row.

This method returns None on an empty exprs, which might be surprising, but seems to line up with its callers’ expectations of that being a non-constraint. The caller knows if exprs is empty, and can modify their behavior appropriately. if they would rather have a literal empty row.

source

pub fn extract_from_expression( expr: &MirRelationExpr, ) -> (Self, &MirRelationExpr)

Extracts any MapFilterProject at the root of the expression.

The expression will be modified to extract any maps, filters, and projections, which will be returned as Self. If there are no maps, filters, or projections the method will return an identity operator.

The extracted expressions may contain temporal predicates, and one should be careful to apply them blindly.

source

pub fn extract_non_errors_from_expr( expr: &MirRelationExpr, ) -> (Self, &MirRelationExpr)

Extracts an error-free MapFilterProject at the root of the expression.

The expression will be modified to extract maps, filters, and projects from the root of the expression, which will be returned as Self. The extraction will halt if a Map or Filter containing a literal error is reached. Otherwise, the method will return an identity operator.

This method is meant to be used during optimization, where it is necessary to avoid moving around maps and filters with errors.

source

pub fn extract_non_errors_from_expr_ref_mut( expr: &mut MirRelationExpr, ) -> (Self, &mut MirRelationExpr)

Extracts an error-free MapFilterProject at the root of the expression.

Differs from MapFilterProject::extract_non_errors_from_expr by taking and returning a mutable reference.

source

pub fn extract_non_errors_from_expr_mut(expr: &mut MirRelationExpr) -> Self

Removes an error-free MapFilterProject from the root of the expression.

The expression will be modified to extract maps, filters, and projects from the root of the expression, which will be returned as Self. The extraction will halt if a Map or Filter containing a literal error is reached. Otherwise, the method will return an identity operator, and the expression will remain unchanged.

This method is meant to be used during optimization, where it is necessary to avoid moving around maps and filters with errors.

source

pub fn extract_temporal(&mut self) -> Self

Extracts temporal predicates into their own Self.

Expressions that are used by the temporal predicates are exposed by self.projection, though there could be justification for extracting them as well if they are otherwise unused.

This separation is valuable when the execution cannot be fused into one operator.

source

pub fn extract_common(mfps: &mut [&mut Self]) -> Self

Extracts common expressions from multiple Self into a result Self.

The argument mfps are mutated so that each are functionaly equivalent to their corresponding input, when composed atop the resulting Self.

source

pub fn take(&mut self) -> Self

Returns self, and leaves behind an identity operator that acts on its output.

source

pub fn into_plan(self) -> Result<MfpPlan, String>

Convert the MapFilterProject into a staged evaluation plan.

The main behavior is extract temporal predicates, which cannot be evaluated using the standard machinery.

source§

impl MapFilterProject

source

pub fn partition( self, available: BTreeMap<usize, usize>, input_arity: usize, ) -> (Self, Self)

Partitions self into two instances, one of which can be eagerly applied.

The available argument indicates which input columns are available (keys) and in which positions (values). This information may allow some maps and filters to execute. The input_arity argument reports the total number of input columns (which may include some not present in available)

This method partitions self in two parts, (before, after), where before can be applied on columns present as keys in available, and after must await the introduction of the other input columns.

The before instance will append any columns that can be determined from available but will project away any of these columns that are not needed by after. Importantly, this means that before will leave intact all input columns including those not referenced in available.

The after instance will presume all input columns are available, followed by the appended columns of the before instance. It may be that some input columns can be projected away in before if after does not need them, but we leave that as something the caller can apply if needed (it is otherwise complicated to negotiate which input columns before should retain).

To correctly reconstruct self from before and after, one must introduce additional input columns, permute all input columns to their locations as expected by self, follow this by new columns appended by before, and remove all other columns that may be present.

§Example
use mz_expr::{BinaryFunc, MapFilterProject, MirScalarExpr};

// imagine an action on columns (a, b, c, d).
let original = MapFilterProject::new(4).map(vec![
   MirScalarExpr::column(0).call_binary(MirScalarExpr::column(1), BinaryFunc::AddInt64),
   MirScalarExpr::column(2).call_binary(MirScalarExpr::column(4), BinaryFunc::AddInt64),
   MirScalarExpr::column(3).call_binary(MirScalarExpr::column(5), BinaryFunc::AddInt64),
]).project(vec![6]);

// Imagine we start with columns (b, x, a, y, c).
//
// The `partition` method requires a map from *expected* input columns to *actual*
// input columns. In the example above, the columns a, b, and c exist, and are at
// locations 2, 0, and 4 respectively. We must construct a map to this effect.
let mut available_columns = std::collections::BTreeMap::new();
available_columns.insert(0, 2);
available_columns.insert(1, 0);
available_columns.insert(2, 4);
// Partition `original` using the available columns and current input arity.
// This informs `partition` which columns are available, where they can be found,
// and how many columns are not relevant but should be preserved.
let (before, after) = original.partition(available_columns, 5);

// `before` sees all five input columns, and should append `a + b + c`.
assert_eq!(before, MapFilterProject::new(5).map(vec![
   MirScalarExpr::column(2).call_binary(MirScalarExpr::column(0), BinaryFunc::AddInt64),
   MirScalarExpr::column(4).call_binary(MirScalarExpr::column(5), BinaryFunc::AddInt64),
]).project(vec![0, 1, 2, 3, 4, 6]));

// `after` expects to see `(a, b, c, d, a + b + c)`.
assert_eq!(after, MapFilterProject::new(5).map(vec![
   MirScalarExpr::column(3).call_binary(MirScalarExpr::column(4), BinaryFunc::AddInt64)
]).project(vec![5]));

// To reconstruct `self`, we must introduce the columns that are not present,
// and present them in the order intended by `self`. In this example, we must
// introduce column d and permute the columns so that they begin (a, b, c, d).
// The columns x and y must be projected away, and any columns introduced by
// `begin` must be retained in their current order.

// The `after` instance expects to be provided with all inputs, but it
// may not need all inputs. The `demand()` and `permute()` methods can
// optimize the representation.
source

pub fn demand(&self) -> BTreeSet<usize>

Lists input columns whose values are used in outputs.

It is entirely appropriate to determine the demand of an instance and then both apply a projection to the subject of the instance and self.permute this instance.

source

pub fn permute_fn<F>(&mut self, remap: F, new_input_arity: usize)
where F: Fn(usize) -> usize,

Update input column references, due to an input projection or permutation.

The shuffle argument remaps expected column identifiers to new locations, with the expectation that shuffle describes all input columns, and so the intermediate results will be able to start at position shuffle.len().

The supplied shuffle might not list columns that are not “demanded” by the instance, and so we should ensure that self is optimized to not reference columns that are not demanded.

source§

impl MapFilterProject

source

pub fn optimize(&mut self)

Optimize the internal expression evaluation order.

This method performs several optimizations that are meant to streamline the execution of the MapFilterProject instance, but not to alter its semantics. This includes extracting expressions that are used multiple times, inlining those that are not, and removing expressions that are unreferenced.

This method will inline all temporal expressions, and remove any columns that are not demanded by the output, which should transform any temporal filters to a state where the temporal expressions exist only in the list of predicates.

§Example

This example demonstrates how the re-use of one expression, converting column 1 from a string to an integer, can be extracted and the results shared among the two uses. This example is used for each of the steps along the optimization path.

use mz_expr::{func, MapFilterProject, MirScalarExpr, UnaryFunc, BinaryFunc};
// Demonstrate extraction of common expressions (here: parsing strings).
let mut map_filter_project = MapFilterProject::new(5)
    .map(vec![
        MirScalarExpr::column(0).call_unary(UnaryFunc::CastStringToInt64(func::CastStringToInt64)).call_binary(MirScalarExpr::column(1).call_unary(UnaryFunc::CastStringToInt64(func::CastStringToInt64)), BinaryFunc::AddInt64),
        MirScalarExpr::column(1).call_unary(UnaryFunc::CastStringToInt64(func::CastStringToInt64)).call_binary(MirScalarExpr::column(2).call_unary(UnaryFunc::CastStringToInt64(func::CastStringToInt64)), BinaryFunc::AddInt64),
    ])
    .project(vec![3,4,5,6]);

let mut expected_optimized = MapFilterProject::new(5)
    .map(vec![
        MirScalarExpr::column(1).call_unary(UnaryFunc::CastStringToInt64(func::CastStringToInt64)),
        MirScalarExpr::column(0).call_unary(UnaryFunc::CastStringToInt64(func::CastStringToInt64)).call_binary(MirScalarExpr::column(5), BinaryFunc::AddInt64),
        MirScalarExpr::column(5).call_binary(MirScalarExpr::column(2).call_unary(UnaryFunc::CastStringToInt64(func::CastStringToInt64)), BinaryFunc::AddInt64),
    ])
    .project(vec![3,4,6,7]);

// Optimize the expression.
map_filter_project.optimize();

assert_eq!(
    map_filter_project,
    expected_optimized,
);
source

pub fn size(&self) -> usize

Total expression sizes across all expressions.

source

pub fn memoize_expressions(&mut self)

Place each certainly evaluated expression in its own column.

This method places each non-trivial, certainly evaluated expression in its own column, and deduplicates them so that all references to the same expression reference the same column.

This transformation is restricted to expressions we are certain will be evaluated, which does not include expressions in if statements.

§Example

This example demonstrates how memoization notices MirScalarExprs that are used multiple times, and ensures that each are extracted into columns and then referenced by column. This pass does not try to minimize the occurrences of column references, which will happen in inlining.

use mz_expr::{func, MapFilterProject, MirScalarExpr, UnaryFunc, BinaryFunc};
// Demonstrate extraction of common expressions (here: parsing strings).
let mut map_filter_project = MapFilterProject::new(5)
    .map(vec![
        MirScalarExpr::column(0).call_unary(UnaryFunc::CastStringToInt64(func::CastStringToInt64)).call_binary(MirScalarExpr::column(1).call_unary(UnaryFunc::CastStringToInt64(func::CastStringToInt64)), BinaryFunc::AddInt64),
        MirScalarExpr::column(1).call_unary(UnaryFunc::CastStringToInt64(func::CastStringToInt64)).call_binary(MirScalarExpr::column(2).call_unary(UnaryFunc::CastStringToInt64(func::CastStringToInt64)), BinaryFunc::AddInt64),
    ])
    .project(vec![3,4,5,6]);

let mut expected_optimized = MapFilterProject::new(5)
    .map(vec![
        MirScalarExpr::column(0).call_unary(UnaryFunc::CastStringToInt64(func::CastStringToInt64)),
        MirScalarExpr::column(1).call_unary(UnaryFunc::CastStringToInt64(func::CastStringToInt64)),
        MirScalarExpr::column(5).call_binary(MirScalarExpr::column(6), BinaryFunc::AddInt64),
        MirScalarExpr::column(7),
        MirScalarExpr::column(2).call_unary(UnaryFunc::CastStringToInt64(func::CastStringToInt64)),
        MirScalarExpr::column(6).call_binary(MirScalarExpr::column(9), BinaryFunc::AddInt64),
        MirScalarExpr::column(10),
    ])
    .project(vec![3,4,8,11]);

// Memoize expressions, ensuring uniqueness of each `MirScalarExpr`.
map_filter_project.memoize_expressions();

assert_eq!(
    map_filter_project,
    expected_optimized,
);

Expressions may not be memoized if they are not certain to be evaluated, for example if they occur in conditional branches of a MirScalarExpr::If.

use mz_expr::{MapFilterProject, MirScalarExpr, UnaryFunc, BinaryFunc};
// Demonstrate extraction of unconditionally evaluated expressions, as well as
// the non-extraction of common expressions guarded by conditions.
let mut map_filter_project = MapFilterProject::new(2)
    .map(vec![
        MirScalarExpr::If {
            cond: Box::new(MirScalarExpr::column(0).call_binary(MirScalarExpr::column(1), BinaryFunc::Lt)),
            then: Box::new(MirScalarExpr::column(0).call_binary(MirScalarExpr::column(1), BinaryFunc::DivInt64)),
            els:  Box::new(MirScalarExpr::column(1).call_binary(MirScalarExpr::column(0), BinaryFunc::DivInt64)),
        },
        MirScalarExpr::If {
            cond: Box::new(MirScalarExpr::column(0).call_binary(MirScalarExpr::column(1), BinaryFunc::Lt)),
            then: Box::new(MirScalarExpr::column(1).call_binary(MirScalarExpr::column(0), BinaryFunc::DivInt64)),
            els:  Box::new(MirScalarExpr::column(0).call_binary(MirScalarExpr::column(1), BinaryFunc::DivInt64)),
        },
    ]);

let mut expected_optimized = MapFilterProject::new(2)
    .map(vec![
        MirScalarExpr::column(0).call_binary(MirScalarExpr::column(1), BinaryFunc::Lt),
        MirScalarExpr::If {
            cond: Box::new(MirScalarExpr::column(2)),
            then: Box::new(MirScalarExpr::column(0).call_binary(MirScalarExpr::column(1), BinaryFunc::DivInt64)),
            els:  Box::new(MirScalarExpr::column(1).call_binary(MirScalarExpr::column(0), BinaryFunc::DivInt64)),
        },
        MirScalarExpr::column(3),
        MirScalarExpr::If {
            cond: Box::new(MirScalarExpr::column(2)),
            then: Box::new(MirScalarExpr::column(1).call_binary(MirScalarExpr::column(0), BinaryFunc::DivInt64)),
            els:  Box::new(MirScalarExpr::column(0).call_binary(MirScalarExpr::column(1), BinaryFunc::DivInt64)),
        },
        MirScalarExpr::column(5),
    ])
    .project(vec![0,1,4,6]);

// Memoize expressions, ensuring uniqueness of each `MirScalarExpr`.
map_filter_project.memoize_expressions();

assert_eq!(
    map_filter_project,
    expected_optimized,
);
source

pub fn inline_expressions(&mut self)

This method inlines expressions with a single use.

This method only inlines expressions; it does not delete expressions that are no longer referenced. The remove_undemanded() method does that, and should likely be used after this method.

Inlining replaces column references when the referred-to item is either another column reference, or the only referrer of its referent. This is most common after memoization has atomized all expressions to seek out re-use: inlining re-assembles expressions that were not helpfully shared with other expressions.

§Example

In this example, we see that with only a single reference to columns 0 and 2, their parsing can each be inlined. Similarly, column references can be cleaned up among expressions, and in the final projection.

Also notice the remaining expressions, which can be cleaned up in a later pass (the remove_undemanded method).

use mz_expr::{func, MapFilterProject, MirScalarExpr, UnaryFunc, BinaryFunc};
// Use the output from first `memoize_expression` example.
let mut map_filter_project = MapFilterProject::new(5)
    .map(vec![
        MirScalarExpr::column(0).call_unary(UnaryFunc::CastStringToInt64(func::CastStringToInt64)),
        MirScalarExpr::column(1).call_unary(UnaryFunc::CastStringToInt64(func::CastStringToInt64)),
        MirScalarExpr::column(5).call_binary(MirScalarExpr::column(6), BinaryFunc::AddInt64),
        MirScalarExpr::column(7),
        MirScalarExpr::column(2).call_unary(UnaryFunc::CastStringToInt64(func::CastStringToInt64)),
        MirScalarExpr::column(6).call_binary(MirScalarExpr::column(9), BinaryFunc::AddInt64),
        MirScalarExpr::column(10),
    ])
    .project(vec![3,4,8,11]);

let mut expected_optimized = MapFilterProject::new(5)
    .map(vec![
        MirScalarExpr::column(0).call_unary(UnaryFunc::CastStringToInt64(func::CastStringToInt64)),
        MirScalarExpr::column(1).call_unary(UnaryFunc::CastStringToInt64(func::CastStringToInt64)),
        MirScalarExpr::column(0).call_unary(UnaryFunc::CastStringToInt64(func::CastStringToInt64)).call_binary(MirScalarExpr::column(6), BinaryFunc::AddInt64),
        MirScalarExpr::column(0).call_unary(UnaryFunc::CastStringToInt64(func::CastStringToInt64)).call_binary(MirScalarExpr::column(6), BinaryFunc::AddInt64),
        MirScalarExpr::column(2).call_unary(UnaryFunc::CastStringToInt64(func::CastStringToInt64)),
        MirScalarExpr::column(6).call_binary(MirScalarExpr::column(2).call_unary(UnaryFunc::CastStringToInt64(func::CastStringToInt64)), BinaryFunc::AddInt64),
        MirScalarExpr::column(6).call_binary(MirScalarExpr::column(2).call_unary(UnaryFunc::CastStringToInt64(func::CastStringToInt64)), BinaryFunc::AddInt64),
    ])
    .project(vec![3,4,8,11]);

// Inline expressions that are referenced only once.
map_filter_project.inline_expressions();

assert_eq!(
    map_filter_project,
    expected_optimized,
);
source

pub fn perform_inlining(&mut self, should_inline: Vec<bool>)

Inlines those expressions that are indicated by should_inline. See inline_expressions for usage.

source

pub fn remove_undemanded(&mut self)

Removes unused expressions from self.expressions.

Expressions are “used” if they are relied upon by any output columns or any predicates, even transitively. Any expressions that are not relied upon in this way can be discarded.

§Example
use mz_expr::{func, MapFilterProject, MirScalarExpr, UnaryFunc, BinaryFunc};
// Use the output from `inline_expression` example.
let mut map_filter_project = MapFilterProject::new(5)
    .map(vec![
        MirScalarExpr::column(0).call_unary(UnaryFunc::CastStringToInt64(func::CastStringToInt64)),
        MirScalarExpr::column(1).call_unary(UnaryFunc::CastStringToInt64(func::CastStringToInt64)),
        MirScalarExpr::column(0).call_unary(UnaryFunc::CastStringToInt64(func::CastStringToInt64)).call_binary(MirScalarExpr::column(6), BinaryFunc::AddInt64),
        MirScalarExpr::column(0).call_unary(UnaryFunc::CastStringToInt64(func::CastStringToInt64)).call_binary(MirScalarExpr::column(6), BinaryFunc::AddInt64),
        MirScalarExpr::column(2).call_unary(UnaryFunc::CastStringToInt64(func::CastStringToInt64)),
        MirScalarExpr::column(6).call_binary(MirScalarExpr::column(2).call_unary(UnaryFunc::CastStringToInt64(func::CastStringToInt64)), BinaryFunc::AddInt64),
        MirScalarExpr::column(6).call_binary(MirScalarExpr::column(2).call_unary(UnaryFunc::CastStringToInt64(func::CastStringToInt64)), BinaryFunc::AddInt64),
    ])
    .project(vec![3,4,8,11]);

let mut expected_optimized = MapFilterProject::new(5)
    .map(vec![
        MirScalarExpr::column(1).call_unary(UnaryFunc::CastStringToInt64(func::CastStringToInt64)),
        MirScalarExpr::column(0).call_unary(UnaryFunc::CastStringToInt64(func::CastStringToInt64)).call_binary(MirScalarExpr::column(5), BinaryFunc::AddInt64),
        MirScalarExpr::column(5).call_binary(MirScalarExpr::column(2).call_unary(UnaryFunc::CastStringToInt64(func::CastStringToInt64)), BinaryFunc::AddInt64),
    ])
    .project(vec![3,4,6,7]);

// Remove undemanded expressions, streamlining the work done..
map_filter_project.remove_undemanded();

assert_eq!(
    map_filter_project,
    expected_optimized,
);

Trait Implementations§

source§

impl Arbitrary for MapFilterProject

Use a custom Arbitrary implementation to cap the number of internal MirScalarExpr referenced by the generated MapFilterProject instances.

§

type Parameters = ()

The type of parameters that arbitrary_with accepts for configuration of the generated Strategy. Parameters must implement Default.
§

type Strategy = BoxedStrategy<MapFilterProject>

The type of Strategy used to generate values of type Self.
source§

fn arbitrary_with(_: Self::Parameters) -> Self::Strategy

Generates a Strategy for producing arbitrary values of type the implementing type (Self). The strategy is passed the arguments given in args. Read more
source§

fn arbitrary() -> Self::Strategy

Generates a Strategy for producing arbitrary values of type the implementing type (Self). Read more
source§

impl Clone for MapFilterProject

source§

fn clone(&self) -> MapFilterProject

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

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

Performs copy-assignment from source. Read more
source§

impl Debug for MapFilterProject

source§

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

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

impl<'de> Deserialize<'de> for MapFilterProject

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 MapFilterProject

source§

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

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

impl Hash for MapFilterProject

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 MapFilterProject

source§

fn cmp(&self, other: &MapFilterProject) -> 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 + PartialOrd,

Restrict a value to a certain interval. Read more
source§

impl PartialEq for MapFilterProject

source§

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

source§

fn partial_cmp(&self, other: &MapFilterProject) -> 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 RustType<ProtoMapFilterProject> for MapFilterProject

source§

fn into_proto(&self) -> ProtoMapFilterProject

Convert a Self into a Proto value.
source§

fn from_proto(proto: ProtoMapFilterProject) -> Result<Self, TryFromProtoError>

Consume and convert a Proto back into a Self value. Read more
source§

fn into_proto_owned(self) -> Proto

A zero clone version of Self::into_proto that types can optionally implement, otherwise, the default implementation delegates to Self::into_proto.
source§

impl Serialize for MapFilterProject

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 Eq for MapFilterProject

source§

impl StructuralPartialEq for MapFilterProject

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<T, U> CastInto<U> for T
where U: CastFrom<T>,

source§

fn cast_into(self) -> U

Performs the cast.
source§

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

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

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

source§

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

Compare self to key and return their ordering.
source§

impl<T> CopyAs<T> for T

source§

fn copy_as(self) -> T

source§

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

source§

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

Compare self to key and return true if they are equal.
source§

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

source§

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

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

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

source§

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

Compare self to key and return true if they are equal.
source§

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

source§

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

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

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

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

source§

fn from_ref(input: &T) -> T

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

impl<T> FutureExt for T

source§

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

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

fn with_current_context(self) -> WithContext<Self>

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

impl<T> Hashable for T
where T: Hash,

§

type Output = u64

The type of the output value.
source§

fn hashed(&self) -> u64

A well-distributed integer derived from the data.
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> IntoRequest<T> for T

source§

fn into_request(self) -> Request<T>

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

impl<T, U> OverrideFrom<Option<&T>> for U
where U: OverrideFrom<T>,

source§

fn override_from(self, layer: &Option<&T>) -> U

Override the configuration represented by Self with values from the given layer.
source§

impl<T> Pointable for T

source§

const ALIGN: usize = _

The alignment of pointer.
§

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> PreferredContainer for T
where T: Ord + Clone + 'static,

§

type Container = Vec<T>

The preferred container for the type.
source§

impl<T> ProgressEventTimestamp for T
where T: Data + Debug + Any,

source§

fn as_any(&self) -> &(dyn Any + 'static)

Upcasts this ProgressEventTimestamp to Any. Read more
source§

fn type_name(&self) -> &'static str

Returns the name of the concrete type of this object. Read more
source§

impl<P, R> ProtoType<R> for P
where R: RustType<P>,

source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<'a, S, T> Semigroup<&'a S> for T
where T: Semigroup<S>,

source§

fn plus_equals(&mut self, rhs: &&'a S)

The method of std::ops::AddAssign, for types that do not implement AddAssign.
source§

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

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

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

§

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

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

source§

impl<T> Data for T
where T: Clone + 'static,

source§

impl<T> Data for T
where T: Data + Ord + Debug,

source§

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

source§

impl<T> ExchangeData for T
where T: Data + Data,

source§

impl<T> ExchangeData for T
where T: ExchangeData + Ord + Debug,

source§

impl<T> Sequence for T
where T: Eq + Hash,