arcly-stream 0.1.2

An open-extensible live-media streaming kernel: lock-free zero-copy frame fan-out, instant-start GOP cache, a pluggable multi-protocol ingestion layer (RTMP shipped), and a feature-gated pure-Rust media plane (MPEG-TS/HLS) — runtime, config, and metrics free.
Documentation
//! Stream lifecycle events.

use crate::{AppName, StreamId};

/// A lifecycle event emitted by an [`Application`](super::Application).
#[derive(Debug, Clone)]
pub struct StreamEvent {
    /// Application the event belongs to.
    pub app: AppName,
    /// Stream the event concerns.
    pub stream_id: StreamId,
    /// What happened.
    pub kind: StreamEventKind,
}

/// The kind of a [`StreamEvent`]. `#[non_exhaustive]` — match with a wildcard.
#[derive(Debug, Clone, PartialEq, Eq)]
#[non_exhaustive]
pub enum StreamEventKind {
    /// A publisher claimed the stream and began publishing.
    PublishStarted,
    /// The publisher released the stream.
    PublishEnded,
    /// A subscriber connected.
    SubscriberJoined {
        /// Name of the subscriber's protocol (e.g. `"rtmp"`).
        protocol: String,
    },
    /// A subscriber disconnected.
    SubscriberLeft {
        /// Name of the subscriber's protocol.
        protocol: String,
    },
    /// Recording of the stream began.
    RecordingStarted,
    /// Recording of the stream ended.
    RecordingEnded,
    /// Transcoding of the stream began.
    TranscodeStarted,
    /// Transcoding of the stream ended.
    TranscodeEnded,
    /// An error occurred for the stream.
    Error {
        /// Human-readable error detail.
        message: String,
    },
}