Struct sim::simulator::web::WebSimulation[][src]

pub struct WebSimulation { /* fields omitted */ }

The WebSimulation provides JS/WASM-compatible interfaces to the core Simulation struct. For additional insight on these methods, refer to the associated Simulation methods. Errors are unwrapped, instead of returned, in the WebSimulation methods.

Implementations

impl WebSimulation[src]

pub fn post_json(models: &str, connectors: &str) -> Self[src]

A JS/WASM interface for Simulation.post, which uses JSON representations of the simulation models and connectors.

pub fn put_json(&mut self, models: &str, connectors: &str)[src]

A JS/WASM interface for Simulation.put, which uses JSON representations of the simulation models and connectors.

pub fn get_json(&self) -> String[src]

Get a JSON representation of the full Simulation configuration.

pub fn post_yaml(models: &str, connectors: &str) -> WebSimulation[src]

A JS/WASM interface for Simulation.post, which uses YAML representations of the simulation models and connectors.

pub fn put_yaml(&mut self, models: &str, connectors: &str)[src]

A JS/WASM interface for Simulation.put, which uses YAML representations of the simulation models and connectors.

pub fn get_yaml(&self) -> String[src]

Get a YAML representation of the full Simulation configuration.

pub fn get_messages_js(&self) -> Array[src]

A JS/WASM interface for Simulation.get_messages, which converts the messages to a JavaScript Array.

pub fn get_messages_json(&self) -> String[src]

A JS/WASM interface for Simulation.get_messages, which converts the messages to a JSON string.

pub fn get_messages_yaml(&self) -> String[src]

A JS/WASM interface for Simulation.get_messages, which converts the messages to a YAML string.

pub fn get_global_time(&self) -> f64[src]

An interface to Simulation.get_global_time.

pub fn status(&self, model_id: &str) -> String[src]

An interface to Simulation.status.

pub fn reset(&mut self)[src]

An interface to Simulation.reset.

pub fn reset_messages(&mut self)[src]

An interface to Simulation.reset_messages.

pub fn reset_global_time(&mut self)[src]

An interface to Simulation.reset_global_time

pub fn inject_input_json(&mut self, message: &str)[src]

A JS/WASM interface for Simulation.inject_input, which uses a JSON representation of the injected messages.

pub fn inject_input_yaml(&mut self, message: &str)[src]

A JS/WASM interface for Simulation.inject_input, which uses a YAML representation of the injected messages.

pub fn step_js(&mut self) -> Array[src]

A JS/WASM interface for Simulation.step, which converts the returned messages to a JavaScript Array.

pub fn step_json(&mut self) -> String[src]

A JS/WASM interface for Simulation.step, which converts the returned messages to a JSON string.

pub fn step_yaml(&mut self) -> String[src]

A JS/WASM interface for Simulation.step, which converts the returned messages to a YAML string.

pub fn step_until_js(&mut self, until: f64) -> Array[src]

A JS/WASM interface for Simulation.step_until, which converts the returned messages to a JavaScript Array.

pub fn step_until_json(&mut self, until: f64) -> String[src]

A JS/WASM interface for Simulation.step_until, which converts the returned messages to a JSON string.

pub fn step_until_yaml(&mut self, until: f64) -> String[src]

A JS/WASM interface for Simulation.step_until, which converts the returned messages to a YAML string.

pub fn step_n_js(&mut self, n: usize) -> Array[src]

A JS/WASM interface for Simulation.step_n, which converts the returned messages to a JavaScript Array.

pub fn step_n_json(&mut self, n: usize) -> String[src]

A JS/WASM interface for Simulation.step_n, which converts the returned messages to a JSON string.

pub fn step_n_yaml(&mut self, n: usize) -> String[src]

A JS/WASM interface for Simulation.step_n, which converts the returned messages to a YAML string.

Trait Implementations

impl Default for WebSimulation[src]

impl<'de> Deserialize<'de> for WebSimulation[src]

impl FromWasmAbi for WebSimulation[src]

type Abi = u32

The wasm ABI type that this converts from when coming back out from the ABI boundary. Read more

impl IntoWasmAbi for WebSimulation[src]

type Abi = u32

The wasm ABI type that this converts into when crossing the ABI boundary. Read more

impl OptionFromWasmAbi for WebSimulation[src]

impl OptionIntoWasmAbi for WebSimulation[src]

impl RefFromWasmAbi for WebSimulation[src]

type Abi = u32

The wasm ABI type references to Self are recovered from.

type Anchor = Ref<'static, WebSimulation>

The type that holds the reference to Self for the duration of the invocation of the function that has an &Self parameter. This is required to ensure that the lifetimes don’t persist beyond one function call, and so that they remain anonymous. Read more

impl RefMutFromWasmAbi for WebSimulation[src]

type Abi = u32

Same as RefFromWasmAbi::Abi

type Anchor = RefMut<'static, WebSimulation>

Same as RefFromWasmAbi::Anchor

impl Serialize for WebSimulation[src]

impl WasmDescribe for WebSimulation[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ReturnWasmAbi for T where
    T: IntoWasmAbi
[src]

type Abi = <T as IntoWasmAbi>::Abi

Same as IntoWasmAbi::Abi

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

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