Skip to main content

Module token

Module token 

Source
Expand description

Opaque rendezvous tokens for actor reference exchange.

A token is a capability to contact a rendezvous actor. The creator can hand the token out through any external mechanism; holders can join and exchange typed actor references with the creator.

The protocol has three roles:

Tokens serialize as a single base64-encoded compact JSON string. The JSON payload includes the rendezvous actor ref and the type URIs for C, J, and RendezvousLike<C, J>, so deserialization rejects tokens used with incompatible peer types. std::fmt::Display prints the canonical token, followed by #, followed by the compact JSON payload for inspection. FromStr accepts either the canonical token or this display form; the suffix after # is informational and ignored.

Structs§

Join
Request sent to a rendezvous actor by a token holder.
Joined
Notification delivered to the token creator when a peer joins.
Options
Token join options.
RendezvousLike
The generated behavior struct.
Token
Opaque rendezvous token.

Enums§

JoinResult
Result delivered to a joiner after it attempts to join.
Policy
Token join policy.

Traits§

JoinClient
The custom client trait for this message type.
JoinHandler
The custom handler trait for this message type.
TokenPeer
Type that can be exchanged through a rendezvous token.

Functions§

create
Create a rendezvous token owned by this.