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
sourceimpl 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
sourceimpl<'de> Deserialize<'de> for Message
impl<'de> Deserialize<'de> for Message
sourcefn 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
sourceimpl FromWasmAbi for Message
impl FromWasmAbi for Message
sourceimpl IntoWasmAbi for Message
impl IntoWasmAbi for Message
sourceimpl OptionFromWasmAbi for Message
impl OptionFromWasmAbi for Message
sourceimpl OptionIntoWasmAbi for Message
impl OptionIntoWasmAbi for Message
sourceimpl RefFromWasmAbi for Message
impl RefFromWasmAbi for Message
type Anchor = Ref<'static, Message>
type Anchor = Ref<'static, Message>
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
sourceunsafe fn ref_from_abi(js: Self::Abi) -> Self::Anchor
unsafe fn ref_from_abi(js: Self::Abi) -> Self::Anchor
Recover a Self::Anchor
from Self::Abi
. Read more
sourceimpl RefMutFromWasmAbi for Message
impl RefMutFromWasmAbi 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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ReturnWasmAbi for T where
T: IntoWasmAbi,
impl<T> ReturnWasmAbi for T where
T: IntoWasmAbi,
type Abi = <T as IntoWasmAbi>::Abi
type Abi = <T as IntoWasmAbi>::Abi
Same as IntoWasmAbi::Abi
sourcepub fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
pub 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
. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more