Enum cpclib_asm::preamble::tokens::ExprResult
source · [−]pub enum ExprResult {
Float(OrderedFloat<f64>),
Value(i32),
Char(u8),
Bool(bool),
String(SmolStr),
List(Vec<ExprResult, Global>),
Matrix {
width: usize,
height: usize,
content: Vec<ExprResult, Global>,
},
}Expand description
The successful result of an evaluation. Embeds a real, an integer or a string
Variants
Float(OrderedFloat<f64>)
Value(i32)
Char(u8)
Bool(bool)
String(SmolStr)
List(Vec<ExprResult, Global>)
Matrix
Implementations
sourceimpl ExprResult
impl ExprResult
pub fn is_float(&self) -> bool
pub fn is_int(&self) -> bool
pub fn is_char(&self) -> bool
pub fn is_string(&self) -> bool
pub fn string(&self) -> Result<&str, ExpressionTypeError>
pub fn int(&self) -> Result<i32, ExpressionTypeError>
pub fn float(&self) -> Result<f64, ExpressionTypeError>
pub fn char(&self) -> Result<char, ExpressionTypeError>
pub fn bool(&self) -> Result<bool, ExpressionTypeError>
sourceimpl ExprResult
impl ExprResult
pub fn list_content(&self) -> &[ExprResult]
pub fn list_len(&self) -> usize
pub fn list_get(&self, pos: usize) -> &ExprResult
pub fn list_set(&mut self, pos: usize, value: ExprResult)
sourceimpl ExprResult
impl ExprResult
pub fn matrix_set(&mut self, y: usize, x: usize, value: ExprResult)
pub fn matrix_get(&self, y: usize, x: usize) -> &ExprResult
pub fn matrix_height(&self) -> usize
pub fn matrix_width(&self) -> usize
pub fn matrix_rows(&self) -> &[ExprResult]
pub fn matrix_col(&self, x: usize) -> ExprResult
pub fn matrix_set_col(&mut self, x: usize, values: &[ExprResult])
pub fn matrix_row(&self, y: usize) -> &ExprResult
pub fn matrix_transpose(&self) -> ExprResult
pub fn matrix_cols(&self) -> Vec<ExprResult, Global>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
sourceimpl ExprResult
impl ExprResult
pub fn floor(&self) -> Result<ExprResult, ExpressionTypeError>
pub fn ceil(&self) -> Result<ExprResult, ExpressionTypeError>
pub fn frac(&self) -> Result<ExprResult, ExpressionTypeError>
pub fn sin(&self) -> Result<ExprResult, ExpressionTypeError>
pub fn cos(&self) -> Result<ExprResult, ExpressionTypeError>
pub fn asin(&self) -> Result<ExprResult, ExpressionTypeError>
pub fn acos(&self) -> Result<ExprResult, ExpressionTypeError>
pub fn atan(&self) -> Result<ExprResult, ExpressionTypeError>
pub fn abs(&self) -> Result<ExprResult, ExpressionTypeError>
pub fn ln(&self) -> Result<ExprResult, ExpressionTypeError>
pub fn log10(&self) -> Result<ExprResult, ExpressionTypeError>
pub fn exp(&self) -> Result<ExprResult, ExpressionTypeError>
pub fn sqrt(&self) -> Result<ExprResult, ExpressionTypeError>
pub fn binary_not(&self) -> Result<ExprResult, ExpressionTypeError>
Trait Implementations
sourceimpl<T> Add<T> for ExprResult where
T: AsRef<ExprResult> + Display,
impl<T> Add<T> for ExprResult where
T: AsRef<ExprResult> + Display,
type Output = Result<ExprResult, ExpressionTypeError>
type Output = Result<ExprResult, ExpressionTypeError>
The resulting type after applying the + operator.
sourceimpl AddAssign<ExprResult> for ExprResult
impl AddAssign<ExprResult> for ExprResult
sourcefn add_assign(&mut self, rhs: ExprResult)
fn add_assign(&mut self, rhs: ExprResult)
Performs the += operation. Read more
sourceimpl AsRef<ExprResult> for ExprResult
impl AsRef<ExprResult> for ExprResult
sourcefn as_ref(&self) -> &ExprResult
fn as_ref(&self) -> &ExprResult
Converts this type into a shared reference of the (usually inferred) input type.
sourceimpl BitAnd<ExprResult> for ExprResult
impl BitAnd<ExprResult> for ExprResult
type Output = Result<ExprResult, ExpressionTypeError>
type Output = Result<ExprResult, ExpressionTypeError>
The resulting type after applying the & operator.
sourcefn bitand(self, rhs: ExprResult) -> <ExprResult as BitAnd<ExprResult>>::Output
fn bitand(self, rhs: ExprResult) -> <ExprResult as BitAnd<ExprResult>>::Output
Performs the & operation. Read more
sourceimpl BitOr<ExprResult> for ExprResult
impl BitOr<ExprResult> for ExprResult
type Output = Result<ExprResult, ExpressionTypeError>
type Output = Result<ExprResult, ExpressionTypeError>
The resulting type after applying the | operator.
sourcefn bitor(self, rhs: ExprResult) -> <ExprResult as BitOr<ExprResult>>::Output
fn bitor(self, rhs: ExprResult) -> <ExprResult as BitOr<ExprResult>>::Output
Performs the | operation. Read more
sourceimpl BitXor<ExprResult> for ExprResult
impl BitXor<ExprResult> for ExprResult
type Output = Result<ExprResult, ExpressionTypeError>
type Output = Result<ExprResult, ExpressionTypeError>
The resulting type after applying the ^ operator.
sourcefn bitxor(self, rhs: ExprResult) -> <ExprResult as BitXor<ExprResult>>::Output
fn bitxor(self, rhs: ExprResult) -> <ExprResult as BitXor<ExprResult>>::Output
Performs the ^ operation. Read more
sourceimpl Clone for ExprResult
impl Clone for ExprResult
sourcefn clone(&self) -> ExprResult
fn clone(&self) -> ExprResult
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more
sourceimpl Debug for ExprResult
impl Debug for ExprResult
sourceimpl Display for ExprResult
impl Display for ExprResult
sourceimpl<T> Div<T> for ExprResult where
T: AsRef<ExprResult> + Display,
impl<T> Div<T> for ExprResult where
T: AsRef<ExprResult> + Display,
type Output = Result<ExprResult, ExpressionTypeError>
type Output = Result<ExprResult, ExpressionTypeError>
The resulting type after applying the / operator.
sourceimpl<'_, T> From<&'_ [T]> for ExprResult where
T: Into<ExprResult> + Clone,
impl<'_, T> From<&'_ [T]> for ExprResult where
T: Into<ExprResult> + Clone,
sourcefn from(slice: &[T]) -> ExprResult
fn from(slice: &[T]) -> ExprResult
Converts to this type from the input type.
sourceimpl<'_> From<&'_ SmolStr> for ExprResult
impl<'_> From<&'_ SmolStr> for ExprResult
sourcefn from(f: &SmolStr) -> ExprResult
fn from(f: &SmolStr) -> ExprResult
Converts to this type from the input type.
sourceimpl From<OrderedFloat<f64>> for ExprResult
impl From<OrderedFloat<f64>> for ExprResult
sourcefn from(f: OrderedFloat<f64>) -> ExprResult
fn from(f: OrderedFloat<f64>) -> ExprResult
Converts to this type from the input type.
sourceimpl From<SmolStr> for ExprResult
impl From<SmolStr> for ExprResult
sourcefn from(f: SmolStr) -> ExprResult
fn from(f: SmolStr) -> ExprResult
Converts to this type from the input type.
sourceimpl From<String> for ExprResult
impl From<String> for ExprResult
sourcefn from(f: String) -> ExprResult
fn from(f: String) -> ExprResult
Converts to this type from the input type.
sourceimpl From<bool> for ExprResult
impl From<bool> for ExprResult
sourcefn from(b: bool) -> ExprResult
fn from(b: bool) -> ExprResult
Converts to this type from the input type.
sourceimpl From<char> for ExprResult
impl From<char> for ExprResult
sourcefn from(i: char) -> ExprResult
fn from(i: char) -> ExprResult
Converts to this type from the input type.
sourceimpl From<f64> for ExprResult
impl From<f64> for ExprResult
sourcefn from(f: f64) -> ExprResult
fn from(f: f64) -> ExprResult
Converts to this type from the input type.
sourceimpl From<i32> for ExprResult
impl From<i32> for ExprResult
sourcefn from(i: i32) -> ExprResult
fn from(i: i32) -> ExprResult
Converts to this type from the input type.
sourceimpl From<i8> for ExprResult
impl From<i8> for ExprResult
sourcefn from(i: i8) -> ExprResult
fn from(i: i8) -> ExprResult
Converts to this type from the input type.
sourceimpl From<u16> for ExprResult
impl From<u16> for ExprResult
sourcefn from(i: u16) -> ExprResult
fn from(i: u16) -> ExprResult
Converts to this type from the input type.
sourceimpl From<u8> for ExprResult
impl From<u8> for ExprResult
sourcefn from(i: u8) -> ExprResult
fn from(i: u8) -> ExprResult
Converts to this type from the input type.
sourceimpl From<usize> for ExprResult
impl From<usize> for ExprResult
sourcefn from(i: usize) -> ExprResult
fn from(i: usize) -> ExprResult
Converts to this type from the input type.
sourceimpl LowerHex for ExprResult
impl LowerHex for ExprResult
sourceimpl<T> Mul<T> for ExprResult where
T: AsRef<ExprResult> + Display,
impl<T> Mul<T> for ExprResult where
T: AsRef<ExprResult> + Display,
type Output = Result<ExprResult, ExpressionTypeError>
type Output = Result<ExprResult, ExpressionTypeError>
The resulting type after applying the * operator.
sourceimpl Neg for ExprResult
impl Neg for ExprResult
type Output = Result<ExprResult, ExpressionTypeError>
type Output = Result<ExprResult, ExpressionTypeError>
The resulting type after applying the - operator.
sourceimpl Ord for ExprResult
impl Ord for ExprResult
sourceimpl PartialEq<ExprResult> for ExprResult
impl PartialEq<ExprResult> for ExprResult
sourceimpl PartialOrd<ExprResult> for ExprResult
impl PartialOrd<ExprResult> for ExprResult
sourcefn partial_cmp(&self, other: &ExprResult) -> Option<Ordering>
fn partial_cmp(&self, other: &ExprResult) -> Option<Ordering>
This method returns an ordering between self and other values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
sourceimpl<T> Rem<T> for ExprResult where
T: AsRef<ExprResult> + Display,
impl<T> Rem<T> for ExprResult where
T: AsRef<ExprResult> + Display,
type Output = Result<ExprResult, ExpressionTypeError>
type Output = Result<ExprResult, ExpressionTypeError>
The resulting type after applying the % operator.
sourceimpl Shl<ExprResult> for ExprResult
impl Shl<ExprResult> for ExprResult
type Output = Result<ExprResult, ExpressionTypeError>
type Output = Result<ExprResult, ExpressionTypeError>
The resulting type after applying the << operator.
sourcefn shl(self, rhs: ExprResult) -> <ExprResult as Shl<ExprResult>>::Output
fn shl(self, rhs: ExprResult) -> <ExprResult as Shl<ExprResult>>::Output
Performs the << operation. Read more
sourceimpl Shr<ExprResult> for ExprResult
impl Shr<ExprResult> for ExprResult
type Output = Result<ExprResult, ExpressionTypeError>
type Output = Result<ExprResult, ExpressionTypeError>
The resulting type after applying the >> operator.
sourcefn shr(self, rhs: ExprResult) -> <ExprResult as Shr<ExprResult>>::Output
fn shr(self, rhs: ExprResult) -> <ExprResult as Shr<ExprResult>>::Output
Performs the >> operation. Read more
sourceimpl<T> Sub<T> for ExprResult where
T: AsRef<ExprResult> + Display,
impl<T> Sub<T> for ExprResult where
T: AsRef<ExprResult> + Display,
type Output = Result<ExprResult, ExpressionTypeError>
type Output = Result<ExprResult, ExpressionTypeError>
The resulting type after applying the - operator.
sourceimpl SubAssign<ExprResult> for ExprResult
impl SubAssign<ExprResult> for ExprResult
sourcefn sub_assign(&mut self, rhs: ExprResult)
fn sub_assign(&mut self, rhs: ExprResult)
Performs the -= operation. Read more
sourceimpl UpperHex for ExprResult
impl UpperHex for ExprResult
impl Eq for ExprResult
impl StructuralEq for ExprResult
Auto Trait Implementations
impl RefUnwindSafe for ExprResult
impl Send for ExprResult
impl Sync for ExprResult
impl Unpin for ExprResult
impl UnwindSafe for ExprResult
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcefn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to key and return true if they are equal.
impl<T> FmtForward for T
impl<T> FmtForward for T
fn fmt_binary(self) -> FmtBinary<Self> where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self> where
Self: Binary,
Causes self to use its Binary implementation when Debug-formatted. Read more
fn fmt_display(self) -> FmtDisplay<Self> where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self> where
Self: Display,
Causes self to use its Display implementation when
Debug-formatted. Read more
fn fmt_lower_exp(self) -> FmtLowerExp<Self> where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self> where
Self: LowerExp,
Causes self to use its LowerExp implementation when
Debug-formatted. Read more
fn fmt_lower_hex(self) -> FmtLowerHex<Self> where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self> where
Self: LowerHex,
Causes self to use its LowerHex implementation when
Debug-formatted. Read more
fn fmt_octal(self) -> FmtOctal<Self> where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self> where
Self: Octal,
Causes self to use its Octal implementation when Debug-formatted. Read more
fn fmt_pointer(self) -> FmtPointer<Self> where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self> where
Self: Pointer,
Causes self to use its Pointer implementation when
Debug-formatted. Read more
fn fmt_upper_exp(self) -> FmtUpperExp<Self> where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self> where
Self: UpperExp,
Causes self to use its UpperExp implementation when
Debug-formatted. Read more
fn fmt_upper_hex(self) -> FmtUpperHex<Self> where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self> where
Self: UpperHex,
Causes self to use its UpperHex implementation when
Debug-formatted. Read more
fn fmt_list(self) -> FmtList<Self> where
&'a Self: for<'a> IntoIterator,
fn fmt_list(self) -> FmtList<Self> where
&'a Self: for<'a> IntoIterator,
Formats each item in a sequence. Read more
impl<T> Pipe for T where
T: ?Sized,
impl<T> Pipe for T where
T: ?Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> R
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> R
Pipes by value. This is generally the method you want to use. Read more
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> R where
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> R where
R: 'a,
Borrows self and passes that borrow into the pipe function. Read more
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> R where
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> R where
R: 'a,
Mutably borrows self and passes that borrow into the pipe function. Read more
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R where
Self: Borrow<B>,
B: 'a + ?Sized,
R: 'a,
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R where
Self: Borrow<B>,
B: 'a + ?Sized,
R: 'a,
Borrows self, then passes self.borrow() into the pipe function. Read more
fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R
) -> R where
Self: BorrowMut<B>,
B: 'a + ?Sized,
R: 'a,
fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R
) -> R where
Self: BorrowMut<B>,
B: 'a + ?Sized,
R: 'a,
Mutably borrows self, then passes self.borrow_mut() into the pipe
function. Read more
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R where
Self: AsRef<U>,
U: 'a + ?Sized,
R: 'a,
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R where
Self: AsRef<U>,
U: 'a + ?Sized,
R: 'a,
Borrows self, then passes self.as_ref() into the pipe function.
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R where
Self: AsMut<U>,
U: 'a + ?Sized,
R: 'a,
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R where
Self: AsMut<U>,
U: 'a + ?Sized,
R: 'a,
Mutably borrows self, then passes self.as_mut() into the pipe
function. Read more
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R where
Self: Deref<Target = T>,
T: 'a + ?Sized,
R: 'a,
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R where
Self: Deref<Target = T>,
T: 'a + ?Sized,
R: 'a,
Borrows self, then passes self.deref() into the pipe function.
impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Tap for T
impl<T> Tap for T
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self where
Self: Borrow<B>,
B: ?Sized,
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self where
Self: Borrow<B>,
B: ?Sized,
Immutable access to the Borrow<B> of a value. Read more
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self where
Self: BorrowMut<B>,
B: ?Sized,
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self where
Self: BorrowMut<B>,
B: ?Sized,
Mutable access to the BorrowMut<B> of a value. Read more
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self where
Self: AsRef<R>,
R: ?Sized,
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self where
Self: AsRef<R>,
R: ?Sized,
Immutable access to the AsRef<R> view of a value. Read more
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self where
Self: AsMut<R>,
R: ?Sized,
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self where
Self: AsMut<R>,
R: ?Sized,
Mutable access to the AsMut<R> view of a value. Read more
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self where
Self: Deref<Target = T>,
T: ?Sized,
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self where
Self: Deref<Target = T>,
T: ?Sized,
Immutable access to the Deref::Target of a value. Read more
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self where
Self: DerefMut<Target = T> + Deref,
T: ?Sized,
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self where
Self: DerefMut<Target = T> + Deref,
T: ?Sized,
Mutable access to the Deref::Target of a value. Read more
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
Calls .tap() only in debug builds, and is erased in release builds.
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
Calls .tap_mut() only in debug builds, and is erased in release
builds. Read more
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self where
Self: Borrow<B>,
B: ?Sized,
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self where
Self: Borrow<B>,
B: ?Sized,
Calls .tap_borrow() only in debug builds, and is erased in release
builds. Read more
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self where
Self: BorrowMut<B>,
B: ?Sized,
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self where
Self: BorrowMut<B>,
B: ?Sized,
Calls .tap_borrow_mut() only in debug builds, and is erased in release
builds. Read more
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self where
Self: AsRef<R>,
R: ?Sized,
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self where
Self: AsRef<R>,
R: ?Sized,
Calls .tap_ref() only in debug builds, and is erased in release
builds. Read more
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self where
Self: AsMut<R>,
R: ?Sized,
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self where
Self: AsMut<R>,
R: ?Sized,
Calls .tap_ref_mut() only in debug builds, and is erased in release
builds. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into)Uses borrowed data to replace owned data, usually by cloning. Read more