1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
use crate::StreamCheckError;
use crate::StreamInfo;

/// A check result for a single url
pub struct StreamCheckResult {
    url: String,
    pub info: Result<StreamInfo, StreamCheckError>,
}

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

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