Enum rustpython_ast::Operator
source · pub enum Operator {
Show 13 variants
Add,
Sub,
Mult,
MatMult,
Div,
Mod,
Pow,
LShift,
RShift,
BitOr,
BitXor,
BitAnd,
FloorDiv,
}
Expand description
See also operator
Variants§
Implementations§
source§impl Operator
impl Operator
sourcepub const fn is_mat_mult(&self) -> bool
pub const fn is_mat_mult(&self) -> bool
Returns true
if self
is of variant MatMult
.
sourcepub const fn is_l_shift(&self) -> bool
pub const fn is_l_shift(&self) -> bool
Returns true
if self
is of variant LShift
.
sourcepub const fn is_r_shift(&self) -> bool
pub const fn is_r_shift(&self) -> bool
Returns true
if self
is of variant RShift
.
sourcepub const fn is_bit_xor(&self) -> bool
pub const fn is_bit_xor(&self) -> bool
Returns true
if self
is of variant BitXor
.
sourcepub const fn is_bit_and(&self) -> bool
pub const fn is_bit_and(&self) -> bool
Returns true
if self
is of variant BitAnd
.
sourcepub const fn is_floor_div(&self) -> bool
pub const fn is_floor_div(&self) -> bool
Returns true
if self
is of variant FloorDiv
.
source§impl Operator
impl Operator
pub const fn operator_add(&self) -> Option<OperatorAdd>
pub const fn operator_sub(&self) -> Option<OperatorSub>
pub const fn operator_mult(&self) -> Option<OperatorMult>
pub const fn operator_mat_mult(&self) -> Option<OperatorMatMult>
pub const fn operator_div(&self) -> Option<OperatorDiv>
pub const fn operator_mod(&self) -> Option<OperatorMod>
pub const fn operator_pow(&self) -> Option<OperatorPow>
pub const fn operator_l_shift(&self) -> Option<OperatorLShift>
pub const fn operator_r_shift(&self) -> Option<OperatorRShift>
pub const fn operator_bit_or(&self) -> Option<OperatorBitOr>
pub const fn operator_bit_xor(&self) -> Option<OperatorBitXor>
pub const fn operator_bit_and(&self) -> Option<OperatorBitAnd>
pub const fn operator_floor_div(&self) -> Option<OperatorFloorDiv>
Trait Implementations§
source§impl From<OperatorAdd> for Operator
impl From<OperatorAdd> for Operator
source§fn from(_: OperatorAdd) -> Self
fn from(_: OperatorAdd) -> Self
Converts to this type from the input type.
source§impl From<OperatorBitAnd> for Operator
impl From<OperatorBitAnd> for Operator
source§fn from(_: OperatorBitAnd) -> Self
fn from(_: OperatorBitAnd) -> Self
Converts to this type from the input type.
source§impl From<OperatorBitOr> for Operator
impl From<OperatorBitOr> for Operator
source§fn from(_: OperatorBitOr) -> Self
fn from(_: OperatorBitOr) -> Self
Converts to this type from the input type.
source§impl From<OperatorBitXor> for Operator
impl From<OperatorBitXor> for Operator
source§fn from(_: OperatorBitXor) -> Self
fn from(_: OperatorBitXor) -> Self
Converts to this type from the input type.
source§impl From<OperatorDiv> for Operator
impl From<OperatorDiv> for Operator
source§fn from(_: OperatorDiv) -> Self
fn from(_: OperatorDiv) -> Self
Converts to this type from the input type.
source§impl From<OperatorFloorDiv> for Operator
impl From<OperatorFloorDiv> for Operator
source§fn from(_: OperatorFloorDiv) -> Self
fn from(_: OperatorFloorDiv) -> Self
Converts to this type from the input type.
source§impl From<OperatorLShift> for Operator
impl From<OperatorLShift> for Operator
source§fn from(_: OperatorLShift) -> Self
fn from(_: OperatorLShift) -> Self
Converts to this type from the input type.
source§impl From<OperatorMatMult> for Operator
impl From<OperatorMatMult> for Operator
source§fn from(_: OperatorMatMult) -> Self
fn from(_: OperatorMatMult) -> Self
Converts to this type from the input type.
source§impl From<OperatorMod> for Operator
impl From<OperatorMod> for Operator
source§fn from(_: OperatorMod) -> Self
fn from(_: OperatorMod) -> Self
Converts to this type from the input type.
source§impl From<OperatorMult> for Operator
impl From<OperatorMult> for Operator
source§fn from(_: OperatorMult) -> Self
fn from(_: OperatorMult) -> Self
Converts to this type from the input type.
source§impl From<OperatorPow> for Operator
impl From<OperatorPow> for Operator
source§fn from(_: OperatorPow) -> Self
fn from(_: OperatorPow) -> Self
Converts to this type from the input type.
source§impl From<OperatorRShift> for Operator
impl From<OperatorRShift> for Operator
source§fn from(_: OperatorRShift) -> Self
fn from(_: OperatorRShift) -> Self
Converts to this type from the input type.
source§impl From<OperatorSub> for Operator
impl From<OperatorSub> for Operator
source§fn from(_: OperatorSub) -> Self
fn from(_: OperatorSub) -> Self
Converts to this type from the input type.
source§impl PartialEq<Operator> for OperatorAdd
impl PartialEq<Operator> for OperatorAdd
source§impl PartialEq<Operator> for OperatorBitAnd
impl PartialEq<Operator> for OperatorBitAnd
source§impl PartialEq<Operator> for OperatorBitOr
impl PartialEq<Operator> for OperatorBitOr
source§impl PartialEq<Operator> for OperatorBitXor
impl PartialEq<Operator> for OperatorBitXor
source§impl PartialEq<Operator> for OperatorDiv
impl PartialEq<Operator> for OperatorDiv
source§impl PartialEq<Operator> for OperatorFloorDiv
impl PartialEq<Operator> for OperatorFloorDiv
source§impl PartialEq<Operator> for OperatorLShift
impl PartialEq<Operator> for OperatorLShift
source§impl PartialEq<Operator> for OperatorMatMult
impl PartialEq<Operator> for OperatorMatMult
source§impl PartialEq<Operator> for OperatorMod
impl PartialEq<Operator> for OperatorMod
source§impl PartialEq<Operator> for OperatorMult
impl PartialEq<Operator> for OperatorMult
source§impl PartialEq<Operator> for OperatorPow
impl PartialEq<Operator> for OperatorPow
source§impl PartialEq<Operator> for OperatorRShift
impl PartialEq<Operator> for OperatorRShift
source§impl PartialEq<Operator> for OperatorSub
impl PartialEq<Operator> for OperatorSub
impl Copy for Operator
impl Eq for Operator
impl StructuralPartialEq for Operator
Auto Trait Implementations§
impl Freeze for Operator
impl RefUnwindSafe for Operator
impl Send for Operator
impl Sync for Operator
impl Unpin for Operator
impl UnwindSafe for Operator
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
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)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<T> CloneToUninit for Twhere
T: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more