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§

source§

impl Clone for Peer

source§

fn clone(&self) -> Peer

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Peer

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'de> Deserialize<'de> for Peer

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl Ord for Peer

source§

fn cmp(&self, other: &Self) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Selfwhere Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Selfwhere Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Selfwhere Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
source§

impl PartialEq for Peer

source§

fn eq(&self, other: &Self) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for Peer

source§

fn partial_cmp(&self, other: &Self) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl Serialize for Peer

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl Eq for Peer

Auto Trait Implementations§

§

impl RefUnwindSafe for Peer

§

impl Send for Peer

§

impl Sync for Peer

§

impl Unpin for Peer

§

impl UnwindSafe for Peer

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> CompatExt for T

§

fn compat(self) -> Compat<T>

Applies the [Compat] adapter by value. Read more
§

fn compat_ref(&self) -> Compat<&T>

Applies the [Compat] adapter by shared reference. Read more
§

fn compat_mut(&mut self) -> Compat<&mut T>

Applies the [Compat] adapter by mutable reference. Read more
source§

impl<T> FitForCBox for T

source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

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

§

impl<T> ManuallyDropMut for T

§

type Ret = ManuallyDrop<T>

§

fn manually_drop_mut<'__>(&'__ mut self) -> &'__ mut ManuallyDrop<T>

source§

impl<T> To for Twhere T: ?Sized,

source§

fn to<T>(self) -> Twhere Self: Into<T>,

Converts to T by calling Into<T>::into.
source§

fn try_to<T>(self) -> Result<T, Self::Error>where Self: TryInto<T>,

Tries to convert to T by calling TryInto<T>::try_into.
source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V

source§

impl<T> DeserializeOwned for Twhere T: for<'de> Deserialize<'de>,