pub struct TransportConfig {
    pub peer_to_peer: PeerToPeer,
    pub connect: Connect,
    pub listen: Listen,
    pub global: Global,
}
Expand description

A configuration object specifying which network transports Ditto should use to sync data.

A Ditto object comes with a default transport configuration where all available peer-to-peer transports are enabled. You can customize this by initializing a TransportConfig, adjusting its properties, and supplying it to set_transport_config() on Ditto.

When you initialize a TransportConfig yourself it starts with all transports disabled. You must enable each one directly.

Peer-to-peer transports will automatically discover peers in the vicinity and create connections without any configuration. These are configured inside the peer_to_peer property. To turn each one on, set its enabled property to true.

To connect to a peer at a known location, such as a Ditto Big Peer, add its address inside the connect configuration. These are either host:port strings for raw TCP sync, or a wss://… URL for websockets.

The listen configurations are for specific less common data sync scenarios. Please read the documentation on the Ditto website for examples. Incorrect use of listen can result in insecure configurations.

Fields

peer_to_peer: PeerToPeerconnect: Connectlisten: Listenglobal: Global

Implementations

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Returns the “default value” for a type. Read more
Deserialize this value from the given Serde deserializer. Read more
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more
Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. 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

Returns the argument unchanged.

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.