pub enum Node {
    FastStore(FastStore),
    FastStoreFromResult(FastStoreFromResult),
    BinaryOperation(BinaryOperation),
    Call(Call),
    Condition(Condition),
    Branch(Branch),
    Execute(ExecuteRaw),
    Write(WriteMessage),
    Nop,
}
Expand description

Any node

Variants§

§

FastStore(FastStore)

§

FastStoreFromResult(FastStoreFromResult)

§

BinaryOperation(BinaryOperation)

§

Call(Call)

§

Condition(Condition)

§

Branch(Branch)

§

Execute(ExecuteRaw)

§

Write(WriteMessage)

§

Nop

Does nothing

Implementations§

source§

impl Node

source

pub fn scan<F>(&self, func: &mut F)where F: FnMut(&Node),

Iterates over this node and all other nodes that this node contains. Changing this function also requires changing Node::scan_mut

source

pub fn scan_mut<F>(&mut self, func: &mut F)where F: FnMut(&mut Node),

A copy of the above function, but with mutability enabled …

source

pub fn is_effect_free<'a, 'b: 'a, T>(&'a self, function_map: &'b T) -> boolwhere T: Index<&'a BlockId, Output = Function>,

Returns whether this command has no side effect. sometimes its easier to just to restrict the parameter to a specific type…

source

pub fn has_call(&self) -> bool

Checks whether this node contains a call

source

pub fn variable_accesses<F: FnMut(VariableAccess<'_>)>(&self, visitor: &mut F)

Accepts a callback function as argument and calls it with every variable accessed by this node.

source

pub fn variable_accesses_mut<F: FnMut(VariableAccessMut<'_>)>( &mut self, visitor: &mut F )

See variable_accesses.

source

pub fn writes_to(&self, item_id: ItemId) -> bool

Whether this node could modify item_id.

source

pub fn reads_from(&self, item_id: ItemId) -> bool

Whether this node has a read-dependency on item_id

Trait Implementations§

source§

impl Clone for Node

source§

fn clone(&self) -> Node

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 Node

source§

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

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

impl Display for Node

source§

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

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

impl Extend<Node> for PeepholeOptimizer

source§

fn extend<T: IntoIterator<Item = Node>>(&mut self, iter: T)

Extends a collection with the contents of an iterator. Read more
source§

fn extend_one(&mut self, item: A)

🔬This is a nightly-only experimental API. (extend_one)
Extends a collection with exactly one element.
source§

fn extend_reserve(&mut self, additional: usize)

🔬This is a nightly-only experimental API. (extend_one)
Reserves capacity in a collection for the given number of additional elements. Read more
source§

impl PartialEq for Node

source§

fn eq(&self, other: &Node) -> 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 Eq for Node

source§

impl StructuralEq for Node

source§

impl StructuralPartialEq for Node

Auto Trait Implementations§

§

impl RefUnwindSafe for Node

§

impl !Send for Node

§

impl !Sync for Node

§

impl Unpin for Node

§

impl UnwindSafe for Node

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
§

impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere 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 Twhere 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 Twhere 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 Twhere 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 Twhere 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.