[−][src]Struct prec::Expression
A faithful, always-valid representation of an expression.
It's impossible to throw an error due to the order of token, operator, token
not being respected.
Fields
first_token: To
pairs: Vec<(Op, To)>
Implementations
impl<Op: Copy, To: Clone> Expression<Op, To>
[src]
pub fn new(first_token: To, pairs: Vec<(Op, To)>) -> Self
[src]
ⓘThis example is not tested
// 5 * 6 + 3 / 2 ^ 4 let expression = Expression::new( 5.0f64, vec![ (Op::Mul, 6.0), (Op::Add, 3.0), (Op::Div, 2.0), (Op::Exp, 4.0) ] );
Trait Implementations
impl<Op: Clone + Copy, To: Clone> Clone for Expression<Op, To>
[src]
pub fn clone(&self) -> Expression<Op, To>
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<Op: Debug + Copy, To: Debug + Clone> Debug for Expression<Op, To>
[src]
impl<Op: Copy + Display, To: Clone + Display> Display for Expression<Op, To>
[src]
impl<Op: Copy + Eq, To: Clone + Eq> Eq for Expression<Op, To>
[src]
impl<Op: Copy + PartialEq, To: Clone + PartialEq> PartialEq<Expression<Op, To>> for Expression<Op, To>
[src]
Auto Trait Implementations
impl<Op, To> RefUnwindSafe for Expression<Op, To> where
Op: RefUnwindSafe,
To: RefUnwindSafe,
[src]
Op: RefUnwindSafe,
To: RefUnwindSafe,
impl<Op, To> Send for Expression<Op, To> where
Op: Send,
To: Send,
[src]
Op: Send,
To: Send,
impl<Op, To> Sync for Expression<Op, To> where
Op: Sync,
To: Sync,
[src]
Op: Sync,
To: Sync,
impl<Op, To> Unpin for Expression<Op, To> where
Op: Unpin,
To: Unpin,
[src]
Op: Unpin,
To: Unpin,
impl<Op, To> UnwindSafe for Expression<Op, To> where
Op: UnwindSafe,
To: UnwindSafe,
[src]
Op: UnwindSafe,
To: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,