modality_mutator_server/
lib.rs1#![deny(warnings, clippy::all)]
2use std::collections::BTreeMap;
3#[cfg(feature = "server")]
4pub mod server;
5
6use modality_mutator_protocol::attrs::{AttrKey, AttrVal};
7use uuid::Uuid;
8
9#[derive(serde::Serialize, serde::Deserialize, Clone, Debug)]
11#[cfg_attr(feature = "server", derive(utoipa::ToSchema))]
12pub struct Mutator {
13 #[cfg_attr(feature = "server", schema(example = "abc123"))]
15 pub mutator_correlation_id: String,
16
17 #[cfg_attr(feature = "server", schema())]
19 pub attributes: BTreeMap<AttrKey, AttrVal>,
20}
21
22#[derive(serde::Serialize, serde::Deserialize, Clone)]
24#[cfg_attr(feature = "server", derive(utoipa::ToSchema))]
25pub struct Mutation {
26 #[cfg_attr(feature = "server", schema())]
27 pub mutation: Uuid,
28
29 #[cfg_attr(feature = "server", schema())]
31 pub params: BTreeMap<AttrKey, AttrVal>,
32}
33
34pub type GetAllMutatorsResponse = Vec<Mutator>;
35
36pub const MUTATOR_API_KEY_HEADER: &str = "mutator_apikey";
37pub const MUTATOR_API_CONTROL_HEADER: &str = "x-auxon-mutation-control";