medea_control_api_proto/control/
room.rs1use derive_more::with_trait::{AsRef, Display, From, Into};
4use ref_cast::RefCast;
5#[cfg(feature = "serde")]
6use serde::{Deserialize, Serialize};
7
8use super::{Pipeline, member};
9
10#[derive(Clone, Debug, Eq, PartialEq)]
16#[cfg_attr(feature = "serde", derive(Deserialize, Serialize))]
17pub struct Room {
18 pub id: Id,
22
23 pub spec: Spec,
27}
28
29#[derive(Clone, Debug, Eq, PartialEq)]
33#[cfg_attr(feature = "serde", derive(Deserialize, Serialize))]
34pub struct Spec {
35 pub pipeline: Pipeline<member::Id, PipelineSpec>,
40}
41
42#[derive(Clone, Debug, Eq, From, PartialEq)]
46#[cfg_attr(feature = "serde", derive(Deserialize, Serialize))]
47#[cfg_attr(feature = "serde", serde(tag = "kind", content = "spec"))]
48pub enum PipelineSpec {
49 Member(member::Spec),
54}
55
56#[derive(
60 AsRef,
61 Clone,
62 Debug,
63 Display,
64 Eq,
65 From,
66 Hash,
67 Into,
68 Ord,
69 PartialEq,
70 PartialOrd,
71 RefCast,
72)]
73#[cfg_attr(feature = "serde", derive(Deserialize, Serialize))]
74#[cfg_attr(feature = "serde", serde(transparent))]
75#[from(&str, String)]
76#[into(String)]
77#[repr(transparent)]
78pub struct Id(Box<str>);
79
80#[cfg(feature = "client-api")]
81impl From<medea_client_api_proto::RoomId> for Id {
82 fn from(id: medea_client_api_proto::RoomId) -> Self {
83 id.0.into()
84 }
85}