pub trait TransportConfig:
Registered
+ Serialize
+ DeserializeOwned
+ Default
+ Clone
+ Send
+ Sync { }Expand description
Configuration that can be persisted for a transport.
Each transport implementation can define its own configuration type
that implements this trait. The configuration is stored in the _sync
database’s transports subtree and loaded when the transport is enabled.
Transport configs must also implement Registered to provide their type identifier.
§Example
ⓘ
use serde::{Serialize, Deserialize};
use eidetica::store::Registered;
use eidetica::sync::transports::TransportConfig;
#[derive(Clone, Serialize, Deserialize, Default)]
pub struct MyTransportConfig {
pub some_setting: String,
}
impl Registered for MyTransportConfig {
fn type_id() -> &'static str {
"my-transport:v0"
}
}
impl TransportConfig for MyTransportConfig {}Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.