StateBranch

Struct StateBranch 

Source
pub struct StateBranch {
    pub cond_conversion: Vec<Conversion>,
    pub cond: VarId,
    pub code_if_true: Box<StateElement>,
    pub true_returns: Vec<VarAssignment>,
    pub true_end_conv: Vec<Conversion>,
    pub code_if_false: Box<StateElement>,
    pub false_end_conv: Vec<Conversion>,
    pub false_returns: Vec<VarAssignment>,
    pub pushes: Vec<VarAssignment>,
}
Expand description

A branch between two state elements with variable assignments computed.

Fields§

§cond_conversion: Vec<Conversion>

Conversions applied to acquire the branch condition.

§cond: VarId

Variable which will contain the bool branch condition.

§code_if_true: Box<StateElement>

Code to execute if the condition is true.

§true_returns: Vec<VarAssignment>

Assignments of the pushed values from the true branch. These will be collected into a tuple and assigned to the pushes of the branch in the outer block.

§true_end_conv: Vec<Conversion>

Conversions to apply at the end of the true branch to align its types to the false branch.

§code_if_false: Box<StateElement>

Code to execute if the condition is false.

§false_end_conv: Vec<Conversion>

Conversions to apply at the end of the false branch to align its types to the true branch.

§false_returns: Vec<VarAssignment>

Assignments of the pushed values from the false branch. These will be collected into a tuple and assigned to the pushes of the branch in the outer block.

§pushes: Vec<VarAssignment>

Values pushed onto the parent’s stack in the scope outside of the branch.

Trait Implementations§

Source§

impl Debug for StateBranch

Source§

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

Formats the value using the given formatter. Read more

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> 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, U> TryFrom<U> for T
where U: Into<T>,

Source§

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

Source§

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.