dittolive_ditto ::presence Struct Connection Copy item path 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 >,
}Expand description Represents a connection between two peers in a Ditto mesh network.
This struct is marked as non-exhaustive Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
An 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”
The 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.
The 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.
The type of connection. One Connection will exist
for each connection type that might be active.
A made-up figure that changes based on RSSI. This may become meaningful
if more accurate range-finding transports are added in future.
Performs copy-assignment from
source.
Read more Formats the value using the given formatter.
Read more Deserialize this value from the given Serde deserializer.
Read more Compares and returns the maximum of two values.
Read more Compares and returns the minimum of two values.
Read more Restrict a value to a certain interval.
Read more Tests for self and other values to be equal, and is used by ==.
Tests for !=. The default implementation is almost always sufficient,
and should not be overridden without very good reason.
This method returns an ordering between
self and
other values if one exists.
Read more Tests less than (for
self and
other) and is used by the
< operator.
Read more Tests less than or equal to (for
self and
other) and is used by the
<= operator.
Read more Tests greater than (for
self and
other) and is used by the
>
operator.
Read more Tests greater than or equal to (for
self and
other) and is used by
the
>= operator.
Read more Serialize this value into the given Serde serializer.
Read more Immutably borrows from an owned value.
Read more Mutably borrows from an owned value.
Read more 🔬 This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from
self to
dst.
Read more Applies the [
Compat] adapter by value.
Read more Applies the [
Compat] adapter by shared reference.
Read more Applies the [
Compat] adapter by mutable reference.
Read more Checks if this value is equivalent to the given key.
Read more Returns the argument unchanged.
Instruments this type with the provided [
Span], returning an
Instrumented wrapper.
Read more Calls U::from(self).
That is, this conversion is whatever the implementation of
From <T> for U chooses to do.
Converts to T by calling Into<T>::into.
Tries to convert to T by calling TryInto<T>::try_into.
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning.
Read more Uses borrowed data to replace owned data, usually by cloning.
Read more The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.