av-stream-info-rust 0.13.2

Analyze a http/https internet address and display information if an audio or video stream has been found. All information is extracted from metainformation.
Documentation
use crate::StreamCheckError;
use crate::StreamInfo;
use serde::{Deserialize, Serialize};

#[derive(Debug, Serialize, Deserialize, Clone)]
pub enum UrlType {
    Stream(StreamInfo),
    Playlist(Vec<String>),
}

/// A check result for a single url
#[derive(Debug, Serialize, Deserialize, Clone)]
pub struct StreamCheckResult {
    url: String,
    pub info: Result<UrlType, StreamCheckError>,
}

impl StreamCheckResult {
    pub fn new(url: &str, info: Result<UrlType, StreamCheckError>) -> Self {
        StreamCheckResult {
            url: url.to_string(),
            info,
        }
    }

    pub fn url(&self) -> &str {
        &self.url
    }
}