Enum cpclib_asm::preamble::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§
source§impl 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>
source§impl 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)
source§impl 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>
source§impl 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§
source§impl<T> Add<T> for ExprResultwhere
T: AsRef<ExprResult> + Display,
impl<T> Add<T> for ExprResultwhere T: AsRef<ExprResult> + Display,
§type Output = Result<ExprResult, ExpressionTypeError>
type Output = Result<ExprResult, ExpressionTypeError>
The resulting type after applying the
+ operator.source§impl AddAssign<ExprResult> for ExprResult
impl AddAssign<ExprResult> for ExprResult
source§fn add_assign(&mut self, rhs: ExprResult)
fn add_assign(&mut self, rhs: ExprResult)
Performs the
+= operation. Read moresource§impl AsRef<ExprResult> for ExprResult
impl AsRef<ExprResult> for ExprResult
source§fn as_ref(&self) -> &ExprResult
fn as_ref(&self) -> &ExprResult
Converts this type into a shared reference of the (usually inferred) input type.
source§impl 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.source§fn bitand(self, rhs: ExprResult) -> <ExprResult as BitAnd<ExprResult>>::Output
fn bitand(self, rhs: ExprResult) -> <ExprResult as BitAnd<ExprResult>>::Output
Performs the
& operation. Read moresource§impl 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.source§fn bitor(self, rhs: ExprResult) -> <ExprResult as BitOr<ExprResult>>::Output
fn bitor(self, rhs: ExprResult) -> <ExprResult as BitOr<ExprResult>>::Output
Performs the
| operation. Read moresource§impl 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.source§fn bitxor(self, rhs: ExprResult) -> <ExprResult as BitXor<ExprResult>>::Output
fn bitxor(self, rhs: ExprResult) -> <ExprResult as BitXor<ExprResult>>::Output
Performs the
^ operation. Read moresource§impl Clone for ExprResult
impl Clone for ExprResult
source§fn clone(&self) -> ExprResult
fn clone(&self) -> ExprResult
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresource§impl Debug for ExprResult
impl Debug for ExprResult
source§impl Display for ExprResult
impl Display for ExprResult
source§impl<T> Div<T> for ExprResultwhere
T: AsRef<ExprResult> + Display,
impl<T> Div<T> for ExprResultwhere T: AsRef<ExprResult> + Display,
§type Output = Result<ExprResult, ExpressionTypeError>
type Output = Result<ExprResult, ExpressionTypeError>
The resulting type after applying the
/ operator.source§impl<T> From<&[T]> for ExprResultwhere
T: Into<ExprResult> + Clone,
impl<T> From<&[T]> for ExprResultwhere T: Into<ExprResult> + Clone,
source§fn from(slice: &[T]) -> ExprResult
fn from(slice: &[T]) -> ExprResult
Converts to this type from the input type.
source§impl From<&SmolStr> for ExprResult
impl From<&SmolStr> for ExprResult
source§fn from(f: &SmolStr) -> ExprResult
fn from(f: &SmolStr) -> ExprResult
Converts to this type from the input type.
source§impl From<OrderedFloat<f64>> for ExprResult
impl From<OrderedFloat<f64>> for ExprResult
source§fn from(f: OrderedFloat<f64>) -> ExprResult
fn from(f: OrderedFloat<f64>) -> ExprResult
Converts to this type from the input type.
source§impl From<SmolStr> for ExprResult
impl From<SmolStr> for ExprResult
source§fn from(f: SmolStr) -> ExprResult
fn from(f: SmolStr) -> ExprResult
Converts to this type from the input type.
source§impl From<String> for ExprResult
impl From<String> for ExprResult
source§fn from(f: String) -> ExprResult
fn from(f: String) -> ExprResult
Converts to this type from the input type.
source§impl From<bool> for ExprResult
impl From<bool> for ExprResult
source§fn from(b: bool) -> ExprResult
fn from(b: bool) -> ExprResult
Converts to this type from the input type.
source§impl From<char> for ExprResult
impl From<char> for ExprResult
source§fn from(i: char) -> ExprResult
fn from(i: char) -> ExprResult
Converts to this type from the input type.
source§impl From<f64> for ExprResult
impl From<f64> for ExprResult
source§fn from(f: f64) -> ExprResult
fn from(f: f64) -> ExprResult
Converts to this type from the input type.
source§impl From<i32> for ExprResult
impl From<i32> for ExprResult
source§fn from(i: i32) -> ExprResult
fn from(i: i32) -> ExprResult
Converts to this type from the input type.
source§impl From<i8> for ExprResult
impl From<i8> for ExprResult
source§fn from(i: i8) -> ExprResult
fn from(i: i8) -> ExprResult
Converts to this type from the input type.
source§impl From<u16> for ExprResult
impl From<u16> for ExprResult
source§fn from(i: u16) -> ExprResult
fn from(i: u16) -> ExprResult
Converts to this type from the input type.
source§impl From<u8> for ExprResult
impl From<u8> for ExprResult
source§fn from(i: u8) -> ExprResult
fn from(i: u8) -> ExprResult
Converts to this type from the input type.
source§impl From<usize> for ExprResult
impl From<usize> for ExprResult
source§fn from(i: usize) -> ExprResult
fn from(i: usize) -> ExprResult
Converts to this type from the input type.
source§impl LowerHex for ExprResult
impl LowerHex for ExprResult
source§impl<T> Mul<T> for ExprResultwhere
T: AsRef<ExprResult> + Display,
impl<T> Mul<T> for ExprResultwhere T: AsRef<ExprResult> + Display,
§type Output = Result<ExprResult, ExpressionTypeError>
type Output = Result<ExprResult, ExpressionTypeError>
The resulting type after applying the
* operator.source§impl Neg for ExprResult
impl Neg for ExprResult
§type Output = Result<ExprResult, ExpressionTypeError>
type Output = Result<ExprResult, ExpressionTypeError>
The resulting type after applying the
- operator.source§impl Ord for ExprResult
impl Ord for ExprResult
source§fn cmp(&self, other: &ExprResult) -> Ordering
fn cmp(&self, other: &ExprResult) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl PartialEq<ExprResult> for ExprResult
impl PartialEq<ExprResult> for ExprResult
source§fn eq(&self, other: &ExprResult) -> bool
fn eq(&self, other: &ExprResult) -> bool
This method tests for
self and other values to be equal, and is used
by ==.source§impl PartialOrd<ExprResult> for ExprResult
impl PartialOrd<ExprResult> for ExprResult
source§fn partial_cmp(&self, other: &ExprResult) -> Option<Ordering>
fn partial_cmp(&self, other: &ExprResult) -> Option<Ordering>
1.0.0 · source§fn 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 moresource§impl<T> Rem<T> for ExprResultwhere
T: AsRef<ExprResult> + Display,
impl<T> Rem<T> for ExprResultwhere T: AsRef<ExprResult> + Display,
§type Output = Result<ExprResult, ExpressionTypeError>
type Output = Result<ExprResult, ExpressionTypeError>
The resulting type after applying the
% operator.source§impl 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.source§fn shl(self, rhs: ExprResult) -> <ExprResult as Shl<ExprResult>>::Output
fn shl(self, rhs: ExprResult) -> <ExprResult as Shl<ExprResult>>::Output
Performs the
<< operation. Read moresource§impl 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.source§fn shr(self, rhs: ExprResult) -> <ExprResult as Shr<ExprResult>>::Output
fn shr(self, rhs: ExprResult) -> <ExprResult as Shr<ExprResult>>::Output
Performs the
>> operation. Read moresource§impl<T> Sub<T> for ExprResultwhere
T: AsRef<ExprResult> + Display,
impl<T> Sub<T> for ExprResultwhere T: AsRef<ExprResult> + Display,
§type Output = Result<ExprResult, ExpressionTypeError>
type Output = Result<ExprResult, ExpressionTypeError>
The resulting type after applying the
- operator.source§impl SubAssign<ExprResult> for ExprResult
impl SubAssign<ExprResult> for ExprResult
source§fn sub_assign(&mut self, rhs: ExprResult)
fn sub_assign(&mut self, rhs: ExprResult)
Performs the
-= operation. Read moresource§impl 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§
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
§impl<T> Conv for T
impl<T> Conv for T
§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.§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.§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.§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.§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.§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.§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.§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.§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 Twhere
T: ?Sized,
impl<T> Pipe for Twhere T: ?Sized,
§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere Self: Sized,
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) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere 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) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere 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) -> Rwhere
Self: Borrow<B>,
B: 'a + ?Sized,
R: 'a,
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> Rwhere Self: Borrow<B>, B: 'a + ?Sized, R: 'a,
§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R
) -> Rwhere
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 ) -> Rwhere Self: BorrowMut<B>, B: 'a + ?Sized, R: 'a,
§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> Rwhere
Self: AsRef<U>,
U: 'a + ?Sized,
R: 'a,
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> Rwhere 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) -> Rwhere
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) -> Rwhere Self: AsMut<U>, U: 'a + ?Sized, R: 'a,
Mutably borrows
self, then passes self.as_mut() 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)) -> Selfwhere
Self: Borrow<B>,
B: ?Sized,
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Selfwhere 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)) -> Selfwhere
Self: BorrowMut<B>,
B: ?Sized,
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Selfwhere 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)) -> Selfwhere
Self: AsRef<R>,
R: ?Sized,
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Selfwhere 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)) -> Selfwhere
Self: AsMut<R>,
R: ?Sized,
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Selfwhere 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)) -> Selfwhere
Self: Deref<Target = T>,
T: ?Sized,
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Selfwhere 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)) -> Selfwhere
Self: DerefMut<Target = T> + Deref,
T: ?Sized,
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Selfwhere 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.§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Selfwhere
Self: Borrow<B>,
B: ?Sized,
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Selfwhere Self: Borrow<B>, B: ?Sized,
Calls
.tap_borrow() only in debug builds, and is erased in release
builds.§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Selfwhere
Self: BorrowMut<B>,
B: ?Sized,
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Selfwhere Self: BorrowMut<B>, B: ?Sized,
Calls
.tap_borrow_mut() only in debug builds, and is erased in release
builds.§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Selfwhere
Self: AsRef<R>,
R: ?Sized,
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Selfwhere Self: AsRef<R>, R: ?Sized,
Calls
.tap_ref() only in debug builds, and is erased in release
builds.§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Selfwhere
Self: AsMut<R>,
R: ?Sized,
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Selfwhere Self: AsMut<R>, R: ?Sized,
Calls
.tap_ref_mut() only in debug builds, and is erased in release
builds.