logo
pub struct Behavior;
Expand description

The Behavior API provides behavior modules functionality for interacting with the world

Implementations

Retrieve a serialized representation of aspect data of the given actor and aspect type if it exists

The serialization format has to be defined in a protocol that is agreed upon with the owning controller module

Batch send OutgoingMessage data back to the controller module

It is important to understand that this doesn’t send the message directly to a behavior instance for processing. It is sent to the controller module who then decides what to do with it.

For performance reasons it is recommended to always batch as many outgoing messages together as that will reduce calls over FFI, which are expensive

TODO: Should return a custom error type through which a user can identify which messages/behavior modules failed and why

Retrieve an iterator over all actors with the given aspect GUID

Retrieves a fixed but random value (different each execution of the behavior module, but maintained on respawn).

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. 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

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.

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

Uses borrowed data to replace owned data, usually by cloning. 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.