pub enum UnOp {
Not,
Neg,
BitNot,
Plus,
}Variants§
Not
Neg
BitNot
Bitwise NOT ~ on integers.
Plus
v7.39 (round 507) — unary +. SPG had no such operator at all:
SELECT +1 parsed only because the lexer reads +1 as one signed
literal, so + 1, +a, +(1) and 1 + +1 were all syntax errors
while PG18 and MariaDB accept every one of them.
It is not a no-op to drop at parse time — PG refuses it on non-numeric operands (“operator does not exist: + boolean”), so the operand’s type has to be seen at eval.
Trait Implementations§
impl Copy for UnOp
impl Eq for UnOp
impl StructuralPartialEq for UnOp
Auto Trait Implementations§
impl Freeze for UnOp
impl RefUnwindSafe for UnOp
impl Send for UnOp
impl Sync for UnOp
impl Unpin for UnOp
impl UnsafeUnpin for UnOp
impl UnwindSafe for UnOp
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
Mutably borrows from an owned value. Read more