Struct arrows::Msg

source · []
pub struct Msg { /* private fields */ }
Expand description

The actual payload received by actors inside a Mail enum construct

Implementations

Construct a new message with binary content with from and to addresses

Update the message with binary content

Create a msg with content as text to an actor(actor1) in the local system

Example
use arrows::send;
use arrows::Msg;

let m = Msg::with_text("A good will message");
send!("actor1", m);

Construct a text message with from and to addresses

Get the content of msg as text. In case - binary content being actually binary this would not be helpful.

Is the message actually a command?

Command action equality check

Get the embedded Action out if this Msg content is really is Command

The message as bytes - irrespective of whether content is text or actual binary blob. Empty byte vec - if can not be serialized

Construct a text reply with content as string and message direction reversed

Update the content of the message - text

Set new binary content and new local recipient actor address

Set the binary content of the message

Set the recipient address of the message

Set the recipient identifier as string literal

Set the recipient actor’s IP - used in remoting

Set the recipient port

Get the port of the recipient actor - used for remote messaging

Reverse the message direction - ‘to’ to ‘from’ or other way

Get the binary content - the message remains intact

If the message content is binary blob - get it Would take content out - leaving message content to a None

Get the address of the actor the message is directed at

Get the id

Get the id as string. Required because unique ids overflow i64 range supported by the backing store

Get the unique id of the actor message is directed at

Get the from address

Check if message is directed at any actor in the system

Set the from address of a message - specific usage while sending out actor message processing outcome

Construct a Shutdown command to shutdown the system listener

Construct a Echo command to send to the system listener to check its liveness

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Deserialize this value from the given Serde deserializer. Read more

Formats the value using the given formatter. Read more

Performs the conversion.

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

This method tests for !=.

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.