Struct sesstype::Message [] [src]

pub struct Message { /* fields omitted */ }

A structure to represent a message passed between Roles.

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]

[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()

[src]

Returns the label of the Message.

Example

use sesstype::Message;

let msg = Message::new("label"); // label()
let _msg_label = msg.label(); // "label"

[src]

Creates a Message with a base type payload.

Example

use sesstype::Message;

let _msg = Message::with_payload_type("label", "int"); // label(int)

[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]

[src]

Formats the value using the given formatter.

impl Clone for Message
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl ToString for Message
[src]

[src]

Converts Message into a human friendly String representation.

The format of the String representation is Label(payload)

impl PartialEq for Message
[src]

[src]

This method tests for self and other values to be equal, and is used by ==. Read more

1.0.0
[src]

This method tests for !=.

impl Eq for Message
[src]

impl Hash for Message
[src]

[src]

Feeds this value into the given [Hasher]. Read more

1.3.0
[src]

Feeds a slice of this type into the given [Hasher]. Read more