Skip to main content

Invocation

Struct Invocation 

Source
pub struct Invocation<'a> {
    pub ids: InvocationIds,
    pub returned: bool,
    pub waiting_at_barrier: bool,
    pub uniform_checks: Vec<(usize, bool)>,
    /* private fields */
}
Expand description

One paused or running invocation.

Fields§

§ids: InvocationIds

Builtin ids for this invocation.

§returned: bool

True after return.

§waiting_at_barrier: bool

True when paused at a barrier.

§uniform_checks: Vec<(usize, bool)>

Uniform-if observations for branches that contain a barrier.

Implementations§

Source§

impl<'a> Invocation<'a>

Source

pub fn new(ids: InvocationIds, entry: &'a [Node]) -> Self

Create an invocation at the start of the entry point.

Source

pub fn done(&self) -> bool

Return true when no further execution can occur.

Source

pub fn push_scope(&mut self)

Push a lexical scope.

use vyre_reference::workgroup::{Invocation, InvocationIds};
let mut invocation = Invocation::new(InvocationIds::ZERO, &[]);
invocation.push_scope();
Source

pub fn pop_scope(&mut self)

Pop a lexical scope and remove bindings declared in it.

use vyre_reference::workgroup::{Invocation, InvocationIds};
let mut invocation = Invocation::new(InvocationIds::ZERO, &[]);
invocation.pop_scope();
Source

pub fn local(&self, name: &str) -> Option<&Value>

Look up an active local by name.

Source

pub fn bind(&mut self, name: &str, value: Value) -> Result<(), Error>

Bind a mutable local.

use vyre_reference::{value::Value, workgroup::{Invocation, InvocationIds}};
fn main() -> Result<(), vyre_foundation::Error> {
    let mut invocation = Invocation::new(InvocationIds::ZERO, &[]);
    invocation.bind("example", Value::U32(1))?;
    Ok(())
}
Source

pub fn bind_loop_var(&mut self, name: &str, value: Value) -> Result<(), Error>

Bind an immutable loop variable.

use vyre_reference::{value::Value, workgroup::{Invocation, InvocationIds}};
fn main() -> Result<(), vyre_foundation::Error> {
    let mut invocation = Invocation::new(InvocationIds::ZERO, &[]);
    invocation.bind_loop_var("example", Value::U32(1))?;
    Ok(())
}
Source

pub fn assign(&mut self, name: &str, value: Value) -> Result<(), Error>

Assign an existing mutable local.

Auto Trait Implementations§

§

impl<'a> Freeze for Invocation<'a>

§

impl<'a> !RefUnwindSafe for Invocation<'a>

§

impl<'a> !Send for Invocation<'a>

§

impl<'a> !Sync for Invocation<'a>

§

impl<'a> Unpin for Invocation<'a>

§

impl<'a> UnsafeUnpin for Invocation<'a>

§

impl<'a> !UnwindSafe for Invocation<'a>

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> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> Same for T

Source§

type Output = T

Should always be Self
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.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more