rokdocs
v0.1

rok::core::ops

Operator traits: the source of every operator token.

rokc binds each token to the trait method carrying its #[infix] / #[prefix] / #[postfix]; precedence and associativity are fixed by the language (3.2.3). #[lang(...)] (6.4) binds each trait to a compiler slot.

Modules

    Traits

    Add

    pub trait Add<Rhs = Self>
    • type Output
    • fn add(self, rhs: Rhs) -> Output

    Modulo

    pub trait Modulo<Rhs = Self>

    %%: floored modulo (2.3) - the result takes the divisor's sign, so a positive divisor gives [0, rhs) (Python's %). No lang slot.

    • type Output
    • fn modulo(self, rhs: Rhs) -> Output

    Sub

    pub trait Sub<Rhs = Self>
    • type Output
    • fn sub(self, rhs: Rhs) -> Output

    Mul

    pub trait Mul<Rhs = Self>
    • type Output
    • fn mul(self, rhs: Rhs) -> Output

    Div

    pub trait Div<Rhs = Self>
    • type Output
    • fn div(self, rhs: Rhs) -> Output

    Rem

    pub trait Rem<Rhs = Self>
    • type Output
    • fn rem(self, rhs: Rhs) -> Output

    Neg

    pub trait Neg
    • type Output
    • fn neg(self) -> Output

    Not

    pub trait Not
    • type Output
    • fn not(self) -> Output

    BitNot

    pub trait BitNot
    • type Output
    • fn bitnot(self) -> Output

    BitAnd

    pub trait BitAnd<Rhs = Self>
    • type Output
    • fn bitand(self, rhs: Rhs) -> Output

    BitOr

    pub trait BitOr<Rhs = Self>
    • type Output
    • fn bitor(self, rhs: Rhs) -> Output

    BitXor

    pub trait BitXor<Rhs = Self>
    • type Output
    • fn bitxor(self, rhs: Rhs) -> Output

    Shl

    pub trait Shl<Rhs = Self>
    • type Output
    • fn shl(self, rhs: Rhs) -> Output

    Shr

    pub trait Shr<Rhs = Self>
    • type Output
    • fn shr(self, rhs: Rhs) -> Output

    PartialEq

    pub trait PartialEq<Rhs = Self>
    • fn eq(self, rhs: Rhs) -> bool
    • const fn ne(self, rhs: Rhs) -> bool

    PartialOrd

    pub trait PartialOrd<Rhs = Self>: PartialEq<Rhs>
    • fn lt(self, rhs: Rhs) -> bool
    • fn gt(self, rhs: Rhs) -> bool
    • fn le(self, rhs: Rhs) -> bool
    • fn ge(self, rhs: Rhs) -> bool
    • const fn partial_cmp(self, rhs: Rhs) -> rok::core::cmp::Ordering | none

      The order, or none when the two are incomparable (NaN).

    LogicalAnd

    pub trait LogicalAnd<Rhs = Self>
    • fn logical_and(self, rhs: Rhs) -> bool

    LogicalOr

    pub trait LogicalOr<Rhs = Self>
    • fn logical_or(self, rhs: Rhs) -> bool

    AddAssign

    pub trait AddAssign<Rhs = Self>

    +=

    • fn add_assign(ref self, rhs: Rhs)

    SubAssign

    pub trait SubAssign<Rhs = Self>

    -=

    • fn sub_assign(ref self, rhs: Rhs)

    MulAssign

    pub trait MulAssign<Rhs = Self>

    *=

    • fn mul_assign(ref self, rhs: Rhs)

    DivAssign

    pub trait DivAssign<Rhs = Self>

    /=

    • fn div_assign(ref self, rhs: Rhs)

    RemAssign

    pub trait RemAssign<Rhs = Self>

    %=

    • fn rem_assign(ref self, rhs: Rhs)

    ModuloAssign

    pub trait ModuloAssign<Rhs = Self>

    %%=

    • fn modulo_assign(ref self, rhs: Rhs)

    BitAndAssign

    pub trait BitAndAssign<Rhs = Self>

    &=

    • fn bitand_assign(ref self, rhs: Rhs)

    BitOrAssign

    pub trait BitOrAssign<Rhs = Self>

    |=

    • fn bitor_assign(ref self, rhs: Rhs)

    BitXorAssign

    pub trait BitXorAssign<Rhs = Self>

    ^=

    • fn bitxor_assign(ref self, rhs: Rhs)

    ShlAssign

    pub trait ShlAssign<Rhs = Self>

    <<=

    • fn shl_assign(ref self, rhs: Rhs)

    ShrAssign

    pub trait ShrAssign<Rhs = Self>

    >>=

    • fn shr_assign(ref self, rhs: Rhs)

    DotAdd

    pub trait DotAdd<Rhs = Self>
    • type Output
    • fn dot_add(self, rhs: Rhs) -> Output

    DotSub

    pub trait DotSub<Rhs = Self>
    • type Output
    • fn dot_sub(self, rhs: Rhs) -> Output

    DotMul

    pub trait DotMul<Rhs = Self>
    • type Output
    • fn dot_mul(self, rhs: Rhs) -> Output

    DotDiv

    pub trait DotDiv<Rhs = Self>
    • type Output
    • fn dot_div(self, rhs: Rhs) -> Output

    DotRem

    pub trait DotRem<Rhs = Self>
    • type Output
    • fn dot_rem(self, rhs: Rhs) -> Output

    DotModulo

    pub trait DotModulo<Rhs = Self>
    • type Output
    • fn dot_modulo(self, rhs: Rhs) -> Output

    DotEq

    pub trait DotEq<Rhs = Self>
    • type Output
    • fn dot_eq(self, rhs: Rhs) -> Output

    DotNe

    pub trait DotNe<Rhs = Self>
    • type Output
    • fn dot_ne(self, rhs: Rhs) -> Output

    DotLt

    pub trait DotLt<Rhs = Self>
    • type Output
    • fn dot_lt(self, rhs: Rhs) -> Output

    DotGt

    pub trait DotGt<Rhs = Self>
    • type Output
    • fn dot_gt(self, rhs: Rhs) -> Output

    DotLe

    pub trait DotLe<Rhs = Self>
    • type Output
    • fn dot_le(self, rhs: Rhs) -> Output

    DotGe

    pub trait DotGe<Rhs = Self>
    • type Output
    • fn dot_ge(self, rhs: Rhs) -> Output

    DotLogicalAnd

    pub trait DotLogicalAnd<Rhs = Self>

    .&& / .||: element-wise, both sides always evaluated (2.6).

    • type Output
    • fn dot_logical_and(self, rhs: Rhs) -> Output

    DotLogicalOr

    pub trait DotLogicalOr<Rhs = Self>
    • type Output
    • fn dot_logical_or(self, rhs: Rhs) -> Output

    DotBitAnd

    pub trait DotBitAnd<Rhs = Self>
    • type Output
    • fn dot_bitand(self, rhs: Rhs) -> Output

    DotBitOr

    pub trait DotBitOr<Rhs = Self>
    • type Output
    • fn dot_bitor(self, rhs: Rhs) -> Output

    DotBitXor

    pub trait DotBitXor<Rhs = Self>
    • type Output
    • fn dot_bitxor(self, rhs: Rhs) -> Output

    DotShl

    pub trait DotShl<Rhs = Self>
    • type Output
    • fn dot_shl(self, rhs: Rhs) -> Output

    DotShr

    pub trait DotShr<Rhs = Self>
    • type Output
    • fn dot_shr(self, rhs: Rhs) -> Output

    Cross

    pub trait Cross<Rhs = Self>
    • type Output
    • fn cross(self, rhs: Rhs) -> Output

    Dot

    pub trait Dot<Rhs = Self>
    • type Output
    • fn dot(self, rhs: Rhs) -> Output

    Compose

    pub trait Compose<Rhs>
    • type Output
    • fn compose(self, rhs: Rhs) -> Output

    Sqrt

    pub trait Sqrt
    • type Output
    • fn sqrt(self) -> Output

    Contains

    pub trait Contains<Item>
    • fn contains(self, item: Item) -> bool
    • const fn not_contains(self, item: Item) -> bool

    Subset

    pub trait Subset<Rhs = Self>
    • fn is_proper_subset(self, rhs: Rhs) -> bool
    • fn is_subset(self, rhs: Rhs) -> bool

    Union

    pub trait Union<Rhs = Self>
    • type Output
    • fn union(self, rhs: Rhs) -> Output

    Intersect

    pub trait Intersect<Rhs = Self>
    • type Output
    • fn intersection(self, rhs: Rhs) -> Output