mz_expr/
virtual_syntax.rs

1// Copyright Materialize, Inc. and contributors. All rights reserved.
2//
3// Use of this software is governed by the Business Source License
4// included in the LICENSE file.
5//
6// As of the Change Date specified in that file, in accordance with
7// the Business Source License, use of this software will be governed
8// by the Apache License, Version 2.0.
9
10//! A set of virtual nodes that are used to recover some high-level
11//! concepts that are desugared to non-trival terms in some IRs.
12
13pub trait IR: Sized {
14    type Relation;
15    type Scalar;
16}
17
18#[allow(missing_debug_implementations)]
19pub struct Except<'a, U: IR> {
20    pub all: bool,
21    pub lhs: &'a U::Relation,
22    pub rhs: &'a U::Relation,
23}
24
25pub trait AlgExcept: IR {
26    fn except(all: &bool, lhs: Self::Relation, rhs: Self::Relation) -> Self::Relation;
27    fn un_except<'a>(expr: &'a Self::Relation) -> Option<Except<'a, Self>>;
28}