spotify_dl/stream/
mod.rs

1pub mod channel_sink;
2pub mod stream;
3
4// Re-export the Stream type for easier access
5pub use stream::Stream;
6
7pub enum StreamEvent {
8    Write {
9        bytes: usize,
10        total: usize,
11        content: Vec<i32>,
12    },
13    Finished,
14    Retry{
15        attempt: usize,
16        max_attempts: usize,
17    },
18    Error(StreamError),
19}
20
21#[derive(Debug, thiserror::Error)]
22pub enum StreamError {
23    #[error("Failed to load track: {0}")]
24    LoadError(String),
25
26    #[error("Unknown error occurred")]
27    Unknown,
28}
29
30pub type StreamEventChannel = tokio::sync::mpsc::UnboundedReceiver<StreamEvent>;