use std::time::Duration;
#[derive(Clone, Debug)]
pub struct Metadata {
title: Option<String>,
artist: Option<String>,
album: Option<String>,
duration: Duration,
sample_rate: u32,
channels: u16,
picture: Option<Vec<u8>>,
}
impl Metadata {
pub fn title(&self) -> Option<&str> {
self.title.as_deref()
}
pub fn artist(&self) -> Option<&str> {
self.artist.as_deref()
}
pub fn album(&self) -> Option<&str> {
self.album.as_deref()
}
pub fn duration(&self) -> Duration {
self.duration
}
pub fn sample_rate(&self) -> u32 {
self.sample_rate
}
pub fn channels(&self) -> u16 {
self.channels
}
pub fn picture(&self) -> Option<&[u8]> {
self.picture.as_deref()
}
}