#[non_exhaustive]pub struct Connection {
pub id: String,
pub peer1: String,
pub peer2: String,
pub connection_type: ConnectionType,
}Expand description
Represents a connection between two peers in a Ditto mesh network.
Fields (Non-exhaustive)§
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.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”
peer1: StringThe peer key of the peer at one end of the connection.
The assignment to peer1 and peer2 is deterministic and stable for
any two peers.
peer2: StringThe peer key of the peer at the other end of the connection.
The assignment to peer1 and peer2 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.
Trait Implementations§
Source§impl Clone for Connection
impl Clone for Connection
Source§fn clone(&self) -> Connection
fn clone(&self) -> Connection
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
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>,
Deserialize this value from the given Serde deserializer. Read more
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
Source§impl Serialize for Connection
impl Serialize for Connection
impl Eq for Connection
Auto Trait Implementations§
impl Freeze for Connection
impl RefUnwindSafe for Connection
impl Send for Connection
impl Sync for Connection
impl Unpin for Connection
impl UnwindSafe for Connection
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> CompatExt for T
impl<T> CompatExt for T
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more