pub struct Msg<W, A> {
pub src: Id,
pub dest: Id,
pub body: Body<W, A>,
}
Expand description
Maelstrom network message
A message envelope containing
- source node identifier,
- destination node identifier,
- and body
Maelstrom defined bodies have a type
field. Inter node message may have a type
field,
populated with their specified message type value.
Messages are parameterized on a workload body type, W
, and an application body type A
.
The workload parameter is required to disambiguate Maelstrom messages when deserializing into the
target Rust type.
Parameters
W
the workload body type, e.g. EchoA
the application body type
Fields§
§src: Id
§dest: Id
§body: Body<W, A>
Trait Implementations§
Source§impl<'de, W, A> Deserialize<'de> for Msg<W, A>where
W: Deserialize<'de>,
A: Deserialize<'de>,
impl<'de, W, A> Deserialize<'de> for Msg<W, A>where
W: Deserialize<'de>,
A: Deserialize<'de>,
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
impl<W: Eq, A: Eq> Eq for Msg<W, A>
impl<W, A> StructuralPartialEq for Msg<W, A>
Auto Trait Implementations§
impl<W, A> Freeze for Msg<W, A>
impl<W, A> RefUnwindSafe for Msg<W, A>where
A: RefUnwindSafe,
W: RefUnwindSafe,
impl<W, A> Send for Msg<W, A>
impl<W, A> Sync for Msg<W, A>
impl<W, A> Unpin for Msg<W, A>
impl<W, A> UnwindSafe for Msg<W, A>where
A: UnwindSafe,
W: UnwindSafe,
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