pub enum ValkyrieOperator {
Show 47 variants Placeholder, Not, Positive, Negative, CovariantType, ContravariantType, Box, Unbox, Unpack { level: u8, }, Reciprocal, Roots(u8), Assign { monadic: bool, }, Plus, PlusAssign, Concat, Less { equal: bool, }, Greater { equal: bool, }, MuchGreater, MuchLess, VeryMuchGreater, VeryMuchLess, Equal { negative: bool, }, StrictlyEqual { negative: bool, }, RangeTo { equal: bool, }, Is { negative: bool, }, In { negative: bool, }, Contains { negative: bool, }, Minus, MinusAssign, Multiply, Divide, Remainder, Modulo, DivideRemainder, DivideFloor, Power, Surd, LogicMatrix { mask: LogicMatrix, }, Map, Optional, QuickRaise, Celsius, Fahrenheit, DivideByDecimal { power: u8, }, Transpose, Transjugate, Hermitian,
}
Expand description

All builtin operator in valkyrie language

Variants§

§

Placeholder

unassigned operator symbol

§

Not

prefix operator: !

§

Positive

prefix operator: +

§

Negative

prefix operator: -

§

CovariantType

prefix type operator: +

§

ContravariantType

prefix type operator: -

§

Box

prefix operator: &

§

Unbox

prefix operator: *

§

Unpack

Fields

§level: u8

unpack level

prefix operator: .., ...

§

Reciprocal

prefix operator:

§

Roots(u8)

prefix operator: , ,

§

Assign

Fields

§monadic: bool

monadic assign: ?=

infix operator: =

§

Plus

binary operator: +

§

PlusAssign

binary operator: +=

§

Concat

binary operator: ++

§

Less

Fields

§equal: bool

binary operator: <=,

binary operator: <

§

Greater

Fields

§equal: bool

binary operator: >=,

binary operator: >

§

MuchGreater

binary operator: , >>

§

MuchLess

binary operator:

§

VeryMuchGreater

binary operator: , >>>

§

VeryMuchLess

binary operator:

§

Equal

Fields

§negative: bool

negative operator !=

binary operator: ,

§

StrictlyEqual

Fields

§negative: bool

negative operator =!=

binary operator: ,

§

RangeTo

Fields

§equal: bool

inclusive operator: ..=

binary operator: ..<, ..=

§

Is

Fields

§negative: bool

negative operator: ⋢, is not

binary operator: ⊑, ⋢, is, is not

§

In

Fields

§negative: bool

negative operator: ∉, not in

binary operator: , , in, not in

§

Contains

Fields

§negative: bool

negative operator: ∉, not in

binary operator: ,

§

Minus

binary operator: -

§

MinusAssign

binary operator: -=

§

Multiply

binary operator: *

§

Divide

binary operator: /

§

Remainder

binary operator: %

§

Modulo

binary operator: ٪, ⁒, %%

§

DivideRemainder

binary operator: ÷, /%

§

DivideFloor

binary operator: /_

§

Power

binary operator: ^

§

Surd

binary operator:

§

LogicMatrix

Fields

§mask: LogicMatrix

binary operator: &, |

binary operator: &, |

§

Map

binary operator: /@

§

Optional

suffix operator: ?

§

QuickRaise

suffix operator: !

§

Celsius

suffix operator:

§

Fahrenheit

suffix operator:

§

DivideByDecimal

Fields

§power: u8

decimal power: a⁒, b%, c‰, d‱

suffix operator: ⁒, %, ‰, ‱

§

Transpose

suffix operator: , \^T, \transpose

§

Transjugate

suffix operator: , \^H, `\conjugate_transpose

§

Hermitian

suffix operator: \hat

Implementations§

source§

impl ValkyrieOperator

source

pub fn precedence(&self) -> Precedence

Get the precedence of the operator, larger number means higher precedence.

source

pub fn as_str(&self) -> &'static str

Get the normalised string representation of the operator.

source

pub fn associativity(&self) -> Associativity

Get the associativity of the operator.

source

pub fn accept_arguments(&self) -> usize

user input arguments

source

pub fn overrideable(&self) -> bool

if this operatr can be override

Trait Implementations§

source§

impl Clone for ValkyrieOperator

source§

fn clone(&self) -> ValkyrieOperator

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for ValkyrieOperator

source§

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

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

impl Display for ValkyrieOperator

source§

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

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

impl From<LogicMatrix> for ValkyrieOperator

source§

fn from(logic: LogicMatrix) -> Self

Converts to this type from the input type.
source§

impl Hash for ValkyrieOperator

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq for ValkyrieOperator

source§

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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Copy for ValkyrieOperator

source§

impl Eq for ValkyrieOperator

source§

impl StructuralPartialEq for ValkyrieOperator

Auto Trait Implementations§

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> Console for T
where T: Display,

source§

fn fg<C>(self, color: C) -> Foreground<Self>
where C: Into<Option<Color>>, Self: Display,

Give this value the specified foreground colour.
source§

fn bg<C>(self, color: C) -> Background<Self>
where C: Into<Option<Color>>, Self: Display,

Give this value the specified background colour.
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,

§

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§

default 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>,

§

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>,

§

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.