Struct dittolive_ditto::transport::Connection
source · #[non_exhaustive]pub struct Connection {
pub id: String,
pub peer_key_string1: String,
pub peer_key_string2: String,
pub connection_type: ConnectionType,
pub approximate_distance_in_meters: Option<f32>,
/* private fields */
}Expand description
Represents a connection between two peers in a Ditto mesh network.
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.id: StringAn string ID in the form "from<->to:connection_type". These ids
are stable: the lower site Id will always be placed first.
Example
“1<->2:Bluetooth”
peer_key_string1: StringThe peer key of the peer at one end of the connection, as a String
The assignment to peer_key_string1 and peer_key_string2 is deterministic
and stable for any two peers.
peer_key_string2: StringThe peer key of the peer at the other end of the connection, as a String
The assignment to peer_key_string1 and peer_key_string2 is deterministic
and stable for any two peers.
connection_type: ConnectionTypeThe type of connection. One Connection will exist
for each connection type that might be active.
approximate_distance_in_meters: Option<f32>A made-up figure that changes based on RSSI. This may become meaningful if more accurate range-finding transports are added in future.
Trait Implementations§
source§impl Clone for Connection
impl Clone for Connection
source§fn clone(&self) -> Connection
fn clone(&self) -> Connection
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moresource§impl Debug for Connection
impl Debug for Connection
source§impl<'de> Deserialize<'de> for Connection
impl<'de> Deserialize<'de> for Connection
source§fn 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>,
source§impl Ord for Connection
impl Ord for Connection
source§impl PartialEq for Connection
impl PartialEq for Connection
source§impl PartialOrd for Connection
impl PartialOrd for Connection
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self and other) and is used by the <=
operator. Read more