Skip to main content

BinOp

Enum BinOp 

Source
pub enum BinOp {
Show 55 variants Or, And, Eq, NotEq, IsDistinctFrom, IsNotDistinctFrom, IntDiv, Lt, LtEq, Gt, GtEq, Add, Sub, Mul, Div, Mod, L2Distance, GeomParallel, OverLeft, OverRight, GeomPerp, GeomSameAs, ClosestPoint, GeomHoriz, InnerProduct, CosineDistance, Concat, BitOr, BitAnd, BitXor, LogicalXor, JsonGet, JsonGetText, JsonGetPath, JsonGetPathText, JsonContains, JsonPathExists, JsonContainedBy, JsonKeyExists, JsonKeysAny, JsonKeysAll, JsonDeletePath, TsMatch, InetContainedBy, InetContainedByEq, InetContains, InetContainsEq, InetOverlap, Intersects, IsBelow, IsAbove, PatternLt, PatternLtEq, PatternGt, PatternGtEq,
}

Variants§

§

Or

§

And

§

Eq

§

NotEq

§

IsDistinctFrom

v7.9.27b — PG a IS DISTINCT FROM b / a IS NOT DISTINCT FROM b. NULL-safe equality: NULL IS NOT DISTINCT FROM NULL → true, NULL IS DISTINCT FROM NULL → false. The non-NULL behaviour matches <> / = exactly. Common in PG-style JOIN ON predicates and pg_dump output.

§

IsNotDistinctFrom

§

IntDiv

v7.39 (round 353, M9) — MySQL’s DIV: integer division that truncates TOWARD ZERO (-7 DIV 2 is -3, measured on MariaDB 11) and answers NULL on a zero divisor. MySQL-dialect only; / there is a real division (round 351).

§

Lt

§

LtEq

§

Gt

§

GtEq

§

Add

§

Sub

§

Mul

§

Div

§

Mod

v7.37.7 C.1.7 — PG / SQL standard integer modulo. Same precedence as Mul/Div; result type follows left operand.

§

L2Distance

pgvector L2 (Euclidean) distance <->. Defined for two vector operands of equal dimension; engine returns Value::Float(d).

§

GeomParallel

v7.39 (read01 geo_ops.c) — ?|| geometric “is parallel”.

§

OverLeft

v7.39 (read01 rangetypes.c) — range &< / &>.

§

OverRight

§

GeomPerp

v7.39 (read01 geo_ops.c) — ?-| geometric “is perpendicular”.

§

GeomSameAs

v7.39 (read01 geo_ops.c) — ~= geometric “same as”.

§

ClosestPoint

v7.39 (read01 geo_ops.c) — ## closest point on the right-hand object to the left-hand one.

§

GeomHoriz

v7.39 (read01 geo_ops.c) — ?- points horizontally aligned.

§

InnerProduct

pgvector inner-product <#> — returns -Σ aᵢ bᵢ so “smaller = more similar” remains true (matches pgvector’s published convention).

§

CosineDistance

pgvector cosine distance <=>1 - (a·b)/(|a| |b|).

§

Concat

SQL string concatenation ||. NULL propagates.

§

BitOr

Bitwise OR | on integers.

§

BitAnd

Bitwise AND & on integers.

§

BitXor

Bitwise XOR # on integers and equal-length bit strings.

§

LogicalXor

v7.39 (round 407) — MySQL’s logical XOR operator. Reads both sides as truth values and returns their exclusive-or (1 XOR 0 is 1, 1 XOR 1 is 0); NULL on either side yields NULL. Only the MySQL dialect produces it; PG has no logical XOR. Its precedence sits between OR (loosest) and AND.

§

JsonGet

v4.14 json -> key — element access by string key (object) or integer index (array). Returns a JSON value.

§

JsonGetText

v4.14 json ->> key — same access, returns the result as TEXT (unwraps a top-level JSON string; renders other scalars as their canonical text).

§

JsonGetPath

v6.4.5 json #> path_text — walk the path encoded as a PG text array literal like '{a,0,b}'. Returns JSON.

§

JsonGetPathText

v6.4.5 json #>> path_text — same walk, returns TEXT.

§

JsonContains

v6.4.5 json @> sub_json — containment. Returns BOOL; true when every key/value in sub_json is structurally present in the left side. Matches PG semantics (top-level + recursive).

§

JsonPathExists

@? — jsonb path existence (jsonb_path_exists).

§

JsonContainedBy

v7.37.6-A json <@ sub_json — contained-by. Returns BOOL; a <@ b is defined as b @> a (same semantics, swapped sides). Eval dispatch reuses JsonContains with swapped args.

§

JsonKeyExists

v7.37.6-A json ? key — key-exists. RHS is TEXT; returns BOOL. For an object, true if key is an existing member name; for an array, true if any element is the string key (PG semantics).

§

JsonKeysAny

v7.37.6-A json ?| keys — any-key-exists. RHS is TEXT[]; returns BOOL.

§

JsonKeysAll

v7.37.6-A json ?& keys — all-keys-exist. RHS is TEXT[]; returns BOOL.

§

JsonDeletePath

jsonb #- path_text[] — delete the value at a nested path. RHS is a PG text-array literal like '{a,b}'; returns JSONB.

§

TsMatch

v7.12.2 tsvector @@ tsquery — FTS match. Returns BOOL; 3VL on NULL. Symmetric: PG also accepts tsquery @@ tsvector and engine eval normalises either ordering.

§

InetContainedBy

v7.17.0 Phase 3.P0-47 — PG INET / CIDR strict contained-in <<. LHS network is strictly inside RHS network (no equality).

§

InetContainedByEq

v7.17.0 Phase 3.P0-47 — PG INET / CIDR contained-in-or-equal <<=. LHS network ⊆ RHS network.

§

InetContains

v7.17.0 Phase 3.P0-47 — PG INET / CIDR strict contains >>. LHS network strictly contains RHS network.

§

InetContainsEq

v7.17.0 Phase 3.P0-47 — PG INET / CIDR contains-or-equal >>=. LHS network ⊇ RHS network.

§

InetOverlap

v7.17.0 Phase 3.P0-47 — PG INET / CIDR network overlap &&. True iff either network contains any address of the other.

§

Intersects

v7.39 (round 508) — ?#, “do these intersect”: box/box, line/box, line/line, lseg/box, lseg/line, lseg/lseg, path/path.

§

IsBelow

v7.39 (round 508) — <^ / >^, strictly below / strictly above (point, box).

§

IsAbove

§

PatternLt

v7.39 (round 508) — the text_pattern_ops comparisons ~<~, ~<=~, ~>~, ~>=~: BYTE order, ignoring collation. 'A' ~<~ 'a' is true where 'A' < 'a' is false under a non-C collation, which is the whole reason the operator family exists — it is what makes a LIKE prefix index-usable. pg_dump writes these into index definitions.

§

PatternLtEq

§

PatternGt

§

PatternGtEq

Trait Implementations§

Source§

impl Clone for BinOp

Source§

fn clone(&self) -> BinOp

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 Copy for BinOp

Source§

impl Debug for BinOp

Source§

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

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

impl Display for BinOp

Source§

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

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

impl Eq for BinOp

Source§

impl PartialEq for BinOp

Source§

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

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

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

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for BinOp

Auto Trait Implementations§

§

impl Freeze for BinOp

§

impl RefUnwindSafe for BinOp

§

impl Send for BinOp

§

impl Sync for BinOp

§

impl Unpin for BinOp

§

impl UnsafeUnpin for BinOp

§

impl UnwindSafe for BinOp

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

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

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

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

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

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

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

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

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

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

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

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

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

Source§

fn to_string(&self) -> String

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

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

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

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

Source§

type Error = <U as TryFrom<T>>::Error

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

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.