Skip to main content

ITreeNode

Enum ITreeNode 

Source
pub enum ITreeNode<E, R> {
    Ret(R),
    Tau(Box<dyn FnOnce() -> ITreeNode<E, R>>),
    Vis(E, Box<dyn Fn(usize) -> ITreeNode<E, R>>),
}
Expand description

An interaction tree node modelling one step of a potentially-infinite computation.

Based on the ITree structure used in verified concurrency frameworks.

Variants§

§

Ret(R)

Pure return value.

§

Tau(Box<dyn FnOnce() -> ITreeNode<E, R>>)

Silent step (τ): delays computation by one tick.

§

Vis(E, Box<dyn Fn(usize) -> ITreeNode<E, R>>)

Visible event e followed by a continuation k.

Implementations§

Source§

impl<E: Clone, R: Clone> ITreeNode<E, R>

Source

pub fn ret(r: R) -> Self

Construct a pure return.

Source

pub fn tau<F: FnOnce() -> ITreeNode<E, R> + 'static>(f: F) -> Self

Construct a tau step.

Source

pub fn vis<K: Fn(usize) -> ITreeNode<E, R> + 'static>(e: E, k: K) -> Self

Construct a visible event step.

Source

pub fn run(self, fuel: usize) -> Option<R>

Spin-up at most fuel tau steps and return the result if reached.

Auto Trait Implementations§

§

impl<E, R> Freeze for ITreeNode<E, R>
where R: Freeze, E: Freeze,

§

impl<E, R> !RefUnwindSafe for ITreeNode<E, R>

§

impl<E, R> !Send for ITreeNode<E, R>

§

impl<E, R> !Sync for ITreeNode<E, R>

§

impl<E, R> Unpin for ITreeNode<E, R>
where R: Unpin, E: Unpin,

§

impl<E, R> UnsafeUnpin for ITreeNode<E, R>
where R: UnsafeUnpin, E: UnsafeUnpin,

§

impl<E, R> !UnwindSafe for ITreeNode<E, R>

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.