Module standard

Source

Structs§

Address
Capability
LazyLoadBlob
PackageId
ProcessId
Request
Response
SendError
Send errors come from trying to send a message to another process, either locally or on another node. A message can fail by timing out, or by the node being entirely unreachable (offline or can’t be found in PKI). In either case, the message is not delivered and the process that sent it receives that message back along with any assigned context and/or lazy-load-blob, and is free to handle it as it sees fit. In the local case, only timeout errors are possible and also cover the case in which a process is not running or does not exist.

Enums§

Message
A message can be a request or a response. Within a response, there is a result which surfaces any error that happened because of a request. A successful response will contain the context of the request it matches, if any was set.
OnExit
On-exit is a setting that determines what happens when a process panics, completes, or otherwise “ends”. NOTE: requests will always have expects-response set to false by kernel.
SendErrorKind
SpawnError

Functions§

clear_state
drop_capabilities
Deletes the capabilities from persisted process state.
get_blob
Returns the blob of the current message, if any.
get_on_exit
˗ˏˋ ♡ ˎˊ˗ Process Management ˗ˏˋ ♡ ˎˊ˗
get_state
has_blob
Returns whether or not the current message has a blob.
last_blob
Returns the last blob this process received.
our
Returns the address of the process.
our_capabilities
Gets all capabilities from persisted process state.
print_to_terminal
˗ˏˋ ♡ ˎˊ˗ System Utils ˗ˏˋ ♡ ˎˊ˗ Prints to the terminal at a given verbosity level. Higher verbosity levels print more information. Level 0 is always printed – use sparingly.
receive
˗ˏˋ ♡ ˎˊ˗ Message I/O ˗ˏˋ ♡ ˎˊ˗ Ingest next message when it arrives along with its source. Almost all long-running processes will call this in a loop.
save_capabilities
˗ˏˋ ♡ ˎˊ˗ Capabilities Management ˗ˏˋ ♡ ˎˊ˗ Saves the capabilities to persisted process state.
send_and_await_response
Send a single request, then block (internally) until its response. The type returned is Message but will always contain Response.
send_request
Send request to target.
send_requests
Send requests to targets.
send_response
Send response to the request currently being handled.
set_on_exit
set_state
spawn

Type Aliases§

Context
Context, like a message body, is a protocol-defined serialized byte array. It is used when building a Request to save information that will not be part of a Response, in order to more easily handle (“contextualize”) that Response.
Json
˗ˏˋ ♡ ˎˊ˗ System Types ˗ˏˋ ♡ ˎˊ˗ JSON is passed over Wasm boundary as a string.
NodeId
In types passed from kernel, node-id will be a valid Hypermap entry.