rtmp_rs/registry/
error.rs1use super::frame::StreamKey;
6
7#[derive(Debug, Clone)]
9pub enum RegistryError {
10 StreamNotFound(StreamKey),
12 StreamAlreadyPublishing(StreamKey),
14 PublisherMismatch,
16 StreamNotActive(StreamKey),
18}
19
20impl std::fmt::Display for RegistryError {
21 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
22 match self {
23 RegistryError::StreamNotFound(key) => write!(f, "Stream not found: {}", key),
24 RegistryError::StreamAlreadyPublishing(key) => {
25 write!(f, "Stream already has a publisher: {}", key)
26 }
27 RegistryError::PublisherMismatch => write!(f, "Publisher ID mismatch"),
28 RegistryError::StreamNotActive(key) => write!(f, "Stream not active: {}", key),
29 }
30 }
31}
32
33impl std::error::Error for RegistryError {}