pub struct Message { /* private fields */ }
Expand description
Messages are the mechanism of information exchange for models in a a simulation. The message must contain origin information (source model ID and source model port), destination information (target model ID and target model port), and the text/content of the message.
Implementations§
source§impl Message
impl Message
sourcepub fn new(
source_id: String,
source_port: String,
target_id: String,
target_port: String,
time: f64,
content: String
) -> Self
pub fn new( source_id: String, source_port: String, target_id: String, target_port: String, time: f64, content: String ) -> Self
This constructor method builds a Message
, which is passed between
simulation models
sourcepub fn source_port(&self) -> &str
pub fn source_port(&self) -> &str
This accessor method returns the source port of a message.
sourcepub fn target_port(&self) -> &str
pub fn target_port(&self) -> &str
This accessor method returns the target port of a message.
Trait Implementations§
source§impl<'de> Deserialize<'de> for Message
impl<'de> Deserialize<'de> for Message
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl FromWasmAbi for Message
impl FromWasmAbi for Message
source§impl IntoWasmAbi for Message
impl IntoWasmAbi for Message
source§impl LongRefFromWasmAbi for Message
impl LongRefFromWasmAbi for Message
source§impl OptionFromWasmAbi for Message
impl OptionFromWasmAbi for Message
source§impl OptionIntoWasmAbi for Message
impl OptionIntoWasmAbi for Message
source§impl RefFromWasmAbi for Message
impl RefFromWasmAbi for Message
source§impl RefMutFromWasmAbi for Message
impl RefMutFromWasmAbi for Message
source§impl TryFromJsValue for Message
impl TryFromJsValue for Message
source§impl VectorFromWasmAbi for Message
impl VectorFromWasmAbi for Message
source§impl VectorIntoWasmAbi for Message
impl VectorIntoWasmAbi for Message
Auto Trait Implementations§
impl RefUnwindSafe for Message
impl Send for Message
impl Sync for Message
impl Unpin for Message
impl UnwindSafe for Message
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
impl<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
§type Abi = <T as IntoWasmAbi>::Abi
type Abi = <T as IntoWasmAbi>::Abi
Same as
IntoWasmAbi::Abi
source§fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
Same as
IntoWasmAbi::into_abi
, except that it may throw and never
return in the case of Err
.