Skip to main content

LoopScope

Struct LoopScope 

Source
struct LoopScope {
    local: BTreeSet<String>,
    carried: BTreeSet<String>,
    independent: bool,
    terminates: bool,
    speculate: bool,
    carried_effects: Vec<Effect>,
}
Expand description

What a loop’s prefix may touch.

Fields§

§local: BTreeSet<String>

Per-iteration names: the loop pattern and everything bound inside the body.

§carried: BTreeSet<String>

Places the body writes that outlive an iteration.

§independent: bool

#[psync::independent]: the programmer asserts iterations do not depend on each other.

§terminates: bool

The body may end the whole loop (?, return, break): later iterations that run ahead may be ones sequential code never reaches.

§speculate: bool

#[psync::speculate] on the loop (or speculate on the function): writes may run ahead anyway.

§carried_effects: Vec<Effect>

Writes in the body whose target is the same in every iteration (not computed from the item): they order every effect on the same resource across iterations.

Implementations§

Source§

impl LoopScope

Source

fn new( rw: &Rewriter<'_>, pattern: &[(Ident, bool)], body: &Block, attrs: &[Attribute], ) -> Self

Source

fn straight() -> Self

The scope of straight-line code: there are no earlier iterations to run ahead of, so only the order within the block (which the scheduler and take_prefix keep) matters.

Source

fn refuses(&self, n: &Node) -> Option<String>

Why n cannot run ahead of earlier iterations, if it cannot.

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.