Explain Serde derives on backend driver enums
This commit is contained in:
@@ -2,12 +2,15 @@ use serde::{Deserialize, Serialize};
|
||||
|
||||
use crate::SqlDriver;
|
||||
|
||||
/// Backend taxonomy. Configuration currently enables SQL and object storage.
|
||||
/// Common backend type for catalog lookups in Rust.
|
||||
///
|
||||
/// Serialized configuration uses category-specific driver types in its fields.
|
||||
/// Deriving Serde traits on this enum would also require them on every wrapped type.
|
||||
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
|
||||
pub enum Driver {
|
||||
Sql(SqlDriver),
|
||||
ObjectStore(ObjectStoreDriver),
|
||||
// Reserved for future adapters.
|
||||
// Reserved categories gain Serde traits when their configuration fields are added.
|
||||
Cache(CacheDriver),
|
||||
Search(SearchDriver),
|
||||
EventStream(EventStreamDriver),
|
||||
@@ -15,6 +18,7 @@ pub enum Driver {
|
||||
OnlineService(OnlineServiceKind),
|
||||
}
|
||||
|
||||
/// The driver in object storage configuration. Serde reads and writes `S3` as `s3`.
|
||||
#[derive(Clone, Copy, Debug, Deserialize, Serialize, Eq, PartialEq)]
|
||||
#[serde(rename_all = "snake_case")]
|
||||
pub enum ObjectStoreDriver {
|
||||
|
||||
Reference in New Issue
Block a user