Struct air_test_framework::execution::AirScriptExecutor

source ·
pub struct AirScriptExecutor<R = DefaultAirRunner> { /* private fields */ }
Expand description

A executor for an AIR script. Several executors may share same TransformedAirScript and its state.

Implementations§

source§

impl AirScriptExecutor<DefaultAirRunner>

source

pub async fn from_annotated( test_parameters: TestRunParameters, annotated_air_script: &str, ) -> Result<Self, String>

Simple constructor where everything is generated from the annotated_air_script.

source§

impl<R: AirRunner> AirScriptExecutor<R>

source

pub async fn from_transformed_air_script( test_parameters: TestRunParameters, test_init_parameters: TestInitParameters, transformed_air_script: TransformedAirScript<R>, ) -> Result<Self, String>

source

pub async fn new( test_parameters: TestRunParameters, common_services: Vec<MarineServiceHandle>, extra_peers: impl IntoIterator<Item = PeerId>, annotated_air_script: &str, ) -> Result<Self, String>

Create execution from the annotated air script.

extra_peers allows you to define peers that are not mentioned in the annotated script explicitly, but are used, e.g. if their names are returned from a call.

source

pub async fn from_network( test_parameters: TestRunParameters, test_init_parameters: TestInitParameters, network: Rc<Network<R>>, annotated_air_script: &str, ) -> Result<Self, String>

source

pub async fn new_with_init_parameters( test_parameters: TestRunParameters, test_init_parameters: TestInitParameters, common_services: Vec<MarineServiceHandle>, extra_peers: impl IntoIterator<Item = PeerId>, annotated_air_script: &str, ) -> Result<Self, String>

source

pub fn execution_iter<'s, Id>( &'s self, peer_id: &Id, ) -> Option<impl Stream<Item = RawAVMOutcome> + 's>
where PeerId: Borrow<Id> + for<'a> From<&'a Id>, Id: Eq + Hash + ?Sized,

Return Iterator for handling all the queued datas for particular peer_id.

source

pub async fn execute_all<Id>(&self, peer_id: &Id) -> Option<Vec<RawAVMOutcome>>
where PeerId: Borrow<Id> + for<'a> From<&'a Id>, Id: Eq + Hash + ?Sized,

Process all queued datas, panicing on error.

source

pub async fn execute_one<Id>(&self, peer_id: &Id) -> Option<RawAVMOutcome>
where PeerId: Borrow<Id> + for<'a> From<&'a Id>, Id: Eq + Hash + ?Sized,

Process one queued data, panicing if it is unavalable or on error.

source

pub fn enqueue(&self, peer_id: impl Into<PeerId>, data: Data)

Push data into peer’s queue.

source

pub fn get_prev_data(&self, peer_id: impl Into<PeerId>) -> Data

source

pub fn resolve_name(&self, name: &str) -> PeerId

source

pub fn get_network(&self) -> Rc<Network<R>>

source

pub fn get_transformed_air_script(&self) -> &TransformedAirScript<R>

Auto Trait Implementations§

§

impl<R> Freeze for AirScriptExecutor<R>

§

impl<R = WasmAirRunner> !RefUnwindSafe for AirScriptExecutor<R>

§

impl<R = WasmAirRunner> !Send for AirScriptExecutor<R>

§

impl<R = WasmAirRunner> !Sync for AirScriptExecutor<R>

§

impl<R> Unpin for AirScriptExecutor<R>

§

impl<R = WasmAirRunner> !UnwindSafe for AirScriptExecutor<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
§

impl<T> ArchivePointee for T

§

type ArchivedMetadata = ()

The archived version of the pointer metadata for this type.
§

fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata

Converts some archived metadata to the pointer metadata for itself.
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
§

impl<F, W, T, D> Deserialize<With<T, W>, D> for F
where W: DeserializeWith<F, T, D>, D: Fallible + ?Sized, F: ?Sized,

§

fn deserialize( &self, deserializer: &mut D, ) -> Result<With<T, W>, <D as Fallible>::Error>

Deserializes using the given deserializer
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>
where T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>
where T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>
where T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

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

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

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.

§

impl<T> LayoutRaw for T

§

fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>

Gets the layout of the type.
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Metadata = ()

The type for metadata in pointers and references to Self.
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( pointer: <T as Pointee>::Pointer, f: &mut Formatter<'_>, ) -> Result<(), Error>

source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

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

§

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.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

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
§

fn with_current_subscriber(self) -> WithDispatch<Self>

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