pub struct Propagator { /* private fields */ }Expand description
A utility for computing Conventions. Given the Convention at the end
of a piece of code, this utility can calculate the Convention at the
beginning.
Implementations§
Source§impl Propagator
impl Propagator
Sourcepub fn new(after: &Convention) -> Self
pub fn new(after: &Convention) -> Self
Constructs a Propagator given the Convention after the code.
Sourcepub fn insert(&mut self, src: impl IntoVariable)
pub fn insert(&mut self, src: impl IntoVariable)
Adds src to lives.
Sourcepub fn remove(&mut self, dest: impl IntoVariable)
pub fn remove(&mut self, dest: impl IntoVariable)
Removes dest from lives.
Sourcepub fn branch(&mut self, other: &Convention)
pub fn branch(&mut self, other: &Convention)
Propagate information backwards through a conditional branch.
Variables live in other are added to lives.
Sourcepub fn switch<'a, C>(
discriminant: Variable,
switch: &'a Switch<C>,
to_convention: impl Fn(&C) -> &'a Convention,
) -> Self
pub fn switch<'a, C>( discriminant: Variable, switch: &'a Switch<C>, to_convention: impl Fn(&C) -> &'a Convention, ) -> Self
Propagate information backwards through a Switch.
Variables live in every case of switch are included in
lives, along with discriminant.
Sourcepub fn action(&mut self, action: Action)
pub fn action(&mut self, action: Action)
Propagate information backwards through action.
Variables written by action are removed from lives
and those read by it are added.
Sourcepub fn before(&self) -> Convention
pub fn before(&self) -> Convention
Returns the Convention before the code.
Auto Trait Implementations§
impl Freeze for Propagator
impl RefUnwindSafe for Propagator
impl Send for Propagator
impl Sync for Propagator
impl Unpin for Propagator
impl UnwindSafe for Propagator
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