Struct dittolive_ditto::transport::Peer
source · [−]pub struct Peer {
pub address: DittoAddress,
pub peer_key: Vec<u8>,
pub device_name: String,
pub os: Option<PresenceOs>,
pub query_overlap_group: u8,
pub is_connected_to_ditto_cloud: bool,
pub is_compatible: Option<bool>,
pub ditto_sdk_version: Option<String>,
pub connections: Vec<UndirectedConnection>,
}
Expand description
Peer in the Ditto mesh.
Fields
address: DittoAddress
An address uniquely representing another device on the Ditto network.
peer_key: Vec<u8>
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).
query_overlap_group: u8
An optional query overlap group which an app developer might provide
to influence connection priorities. Values can range between
0-63 (inclusive). Defaults to 0
if not set.
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<UndirectedConnection>
List of current connections between this peer and other peers.
Trait Implementations
sourceimpl<'de> Deserialize<'de> for Peer
impl<'de> Deserialize<'de> for Peer
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
sourceimpl Ord for Peer
impl Ord for Peer
1.21.0 · sourcefn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
1.21.0 · sourcefn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
1.50.0 · sourcefn clamp(self, min: Self, max: Self) -> Selfwhere
Self: Sized + PartialOrd<Self>,
fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: Sized + PartialOrd<Self>,
sourceimpl PartialOrd<Peer> for Peer
impl PartialOrd<Peer> for Peer
sourcefn partial_cmp(&self, other: &Self) -> Option<Ordering>
fn partial_cmp(&self, other: &Self) -> Option<Ordering>
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read more