Struct dittolive_ditto::transport::Peer
source · #[non_exhaustive]pub struct Peer {
pub address: DittoAddress,
pub peer_key_string: String,
pub device_name: String,
pub os: Option<PresenceOs>,
pub is_connected_to_ditto_cloud: bool,
pub is_compatible: Option<bool>,
pub ditto_sdk_version: Option<String>,
pub connections: Vec<Connection>,
pub peer_metadata: Value,
pub identity_service_metadata: Value,
/* private fields */
}
Expand description
Peer in the Ditto mesh.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.address: DittoAddress
An address uniquely representing another device on the Ditto network.
peer_key_string: String
The peer key is a unique identifier for a given peer, equal to or derived from the cryptographic public key used to authenticate it.
NOTE: This will be be empty when a peer is not updated to the latest version of the SDK.
device_name: String
The human-readable device name for a peer. This defaults to the the hostname but can be manually set by the application developer.
os: Option<PresenceOs>
The operating system of a peer (if known).
is_connected_to_ditto_cloud: bool
Flag which indicates if this peer is connected to HyDRA. This is represented as a simple flag since attempting add HyDRA as a node to a graph would be extremely convoluted. The presence viewer depicts the HyDRA connection with a simple cloud icon above a peer.
is_compatible: Option<bool>
A simplified boolean flag indicating whether the is peer is compatible with our own peer (if known). Note that there might be connections to this peer even if incompatible with our own peer, provided that some other peers are able to interoperate.
ditto_sdk_version: Option<String>
The marketing version of the SDK (if known). For instance: "1.0.3"
.
connections: Vec<Connection>
List of current connections between this peer and other peers.
peer_metadata: Value
Metadata associated with the peer, empty dictionary by default.
Use Presence::set_peer_metadata()
or
Presence::set_peer_metadata_json_str()
to set this value.
Peer metadata is dynamic and may change over the lifecycle of the
PresenceGraph
. It may be empty when a remote peer initially
appears in the presence graph and will be updated once the peer has
synced its metadata with the local peer.
- See also:
Presence::peer_metadata
for details on usage of metadata.
identity_service_metadata: Value
Metadata associated with the peer by the identity service.
Use an authentication webhook to set this value. See Ditto’s online documentation for more information on how to configure an authentication webhook.