Struct sesstype::Message
[−]
[src]
pub struct Message { /* fields omitted */ }
A structure to represent a message passed between Role
s.
A Message
consists of a label, and optionally, a PayloadType
embedded in the Message
.
Note that the payload types are not real types but String
symbols that map to sorts.
Message
should never be shared.
Methods
impl Message
[src]
fn new(label: &str) -> Message
[src]
Creates a new Message
with the given label.
The Message
created by this method will have an empty PayloadType
.
Example
use sesstype::Message; let _msg = Message::new("label"); // label()
fn label(&self) -> &String
[src]
Returns the label of the Message
.
Example
use sesstype::Message; let msg = Message::new("label"); // label() let _msg_label = msg.label(); // "label"
fn with_payload_type(label: &str, payload: &str) -> Message
[src]
Creates a Message
with a base type payload.
Example
use sesstype::Message; let _msg = Message::with_payload_type("label", "int"); // label(int)
fn with_payload_session(label: &str, payload: Box<Type>) -> Message
[src]
Creates a Message
with a session type payload.
Example
use sesstype::Message; use sesstype::local; let _msg = Message::with_payload_session("label", local::Type::end()); // label(end)
Trait Implementations
impl Debug for Message
[src]
impl Clone for Message
[src]
fn clone(&self) -> Message
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl ToString for Message
[src]
fn to_string(&self) -> String
[src]
Converts Message
into a human friendly String
representation.
The format of the String
representation is Label(payload)
impl PartialEq for Message
[src]
fn eq(&self, other: &Message) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests for !=
.