Struct sim::simulator::WebSimulation [−][src]
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]
fn default() -> WebSimulation
[src]
impl<'de> Deserialize<'de> for WebSimulation
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
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
unsafe fn from_abi(js: u32) -> Self
[src]
impl IntoWasmAbi for WebSimulation
[src]
type Abi = u32
The wasm ABI type that this converts into when crossing the ABI boundary. Read more
fn into_abi(self) -> u32
[src]
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
unsafe fn ref_from_abi(js: Self::Abi) -> Self::Anchor
[src]
impl RefMutFromWasmAbi for WebSimulation
[src]
type Abi = u32
Same as RefFromWasmAbi::Abi
type Anchor = RefMut<'static, WebSimulation>
Same as RefFromWasmAbi::Anchor
unsafe fn ref_mut_from_abi(js: Self::Abi) -> Self::Anchor
[src]
impl Serialize for WebSimulation
[src]
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl WasmDescribe for WebSimulation
[src]
Auto Trait Implementations
impl !RefUnwindSafe for WebSimulation
[src]
impl !Send for WebSimulation
[src]
impl !Sync for WebSimulation
[src]
impl Unpin for WebSimulation
[src]
impl !UnwindSafe for WebSimulation
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ReturnWasmAbi for T where
T: IntoWasmAbi,
[src]
T: IntoWasmAbi,
type Abi = <T as IntoWasmAbi>::Abi
Same as IntoWasmAbi::Abi
pub fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,