/// Stable source ID handle that can be used after a source object is moved.
#[derive(Clone, Debug, PartialEq, Eq, Hash)]
pub struct SourceId(String);

impl SourceId {
    pub(crate) fn new(value: String) -> Self {
        Self(value)
    }

    #[must_use]
    /// Returns the source ID as a string.
    pub fn as_str(&self) -> &str {
        &self.0
    }
}

impl AsRef<str> for SourceId {
    fn as_ref(&self) -> &str {
        self.as_str()
    }
}
