#[non_exhaustive]pub enum DittoConfigConnect {
Server {
url: Url,
},
SmallPeersOnly {
private_key: Option<Vec<u8>>,
},
}Expand description
Specifies the connection mechanism to be used by the Ditto instance.
§Example
use dittolive_ditto::prelude::*;
let connect_config = DittoConfigConnect::Server {
url: "https://example.com/your-server-url".parse().unwrap(),
};
let connect_config = DittoConfigConnect::SmallPeersOnly {
private_key: Some("REPLACE_ME_WITH_YOUR_PRIVATE_KEY".bytes().collect()),
};
let connect_config = DittoConfigConnect::SmallPeersOnly { private_key: None };Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Server
Connect to a Ditto “Big Peer” using the provided URL.
When using Server mode, you must provide an authentication expiration
handler using ditto.auth()?.set_expiration_handler(...).
Fields
SmallPeersOnly
Connect only to other Ditto small peers, using the provided private key.
If no private key is provided, sync traffic will be UNENCRYPTED. This mode should NOT be used in production, only for development and testing purposes.
Trait Implementations§
Source§impl Clone for DittoConfigConnect
impl Clone for DittoConfigConnect
Source§fn clone(&self) -> DittoConfigConnect
fn clone(&self) -> DittoConfigConnect
Returns a copy 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 DittoConfigConnect
impl Debug for DittoConfigConnect
Source§impl<'de> Deserialize<'de> for DittoConfigConnect
impl<'de> Deserialize<'de> for DittoConfigConnect
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
Auto Trait Implementations§
impl Freeze for DittoConfigConnect
impl RefUnwindSafe for DittoConfigConnect
impl Send for DittoConfigConnect
impl Sync for DittoConfigConnect
impl Unpin for DittoConfigConnect
impl UnwindSafe for DittoConfigConnect
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