You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: listener.rs
    path of file: ./repos/spot/src/dbus
    
    the code of the file until where you have to start completion: use futures::channel::mpsc::UnboundedSender;
use std::rc::Rc;

use crate::app::{
    components::EventListener,
    models::{RepeatMode, SongDescription},
    state::PlaybackEvent,
    AppEvent, AppModel,
};

use super::types::{LoopStatus, PlaybackStatus, TrackMetadata};

#[derive(Debug)]
pub enum MprisStateUpdate {
    SetVolume(f64),
    SetCurrentTrack {
        has_prev: bool,
        current: Option<TrackMetadata>,
        has_next: bool,
    },
    SetPositionMs(u128),
    SetLoopStatus {
        has_prev: bool,
        loop_status: LoopStatus,
        has_next: bool,
    },
    SetShuffled(bool),
    SetPlaying(PlaybackStatus),
}

pub struct AppPlaybackStateListener {
    app_model: Rc<AppModel>,
    sender: UnboundedSender<MprisStateUpdate>,
}

impl AppPlaybackStateListener {
    pub fn new(app_model: Rc<AppModel>, sender: UnboundedSender<MprisStateUpdate>) -> Self {
        Self { app_model, sender }
    }

    fn make_track_meta(&self) -> Option<TrackMetadata> {
        let SongDescription {
            i
    
    fn update_for(&self, event: &PlaybackEvent) -> Option<MprisStateUpdate> {
        match event {
            PlaybackEvent::PlaybackPaused => {
                Some(MprisStateUpdate::SetPlaying(PlaybackStatus::Paused))
            }
            PlaybackEvent::PlaybackResumed => {
                Some(MprisStateUpdate::SetPlaying(PlaybackStatus::Playing))
            }
            PlaybackEvent::PlaybackStopped => {
                Some(MprisStateUpdate::SetPlaying(PlaybackStatus::Stopped))
            }
            PlaybackEvent::TrackChanged(_) => {
                let current = self.make_track_meta();
                let (has_prev, has_next) = self.has_prev_next();
                Some(MprisStateUpdate::SetCurrentTrack {
                    has_prev,
                    has_next,
                    current,
                })
            }
            PlaybackEvent::RepeatModeChanged(_) => {
                let loop_status = self.loop_status();
                let (has_prev, has_next) = self.has_prev_next();
                Some(MprisStateUpdate::SetLoopStatus {
                    has_prev,
                    has_next,
                    loop_status,
                })
            }
            PlaybackEvent::ShuffleChanged(shuffled) => {
                Some(MprisStateUpdate::SetShuffled(*shuffled))
            }
            PlaybackEvent::TrackSeeked(pos) | PlaybackEvent::SeekSynced(pos) => {
                let pos = 1000 * (*pos as u128);
                Some(MprisStateUpdate::SetPositionMs(pos))
            }
            PlaybackEvent::VolumeSet(vol) => Some(MprisStateUpdate::SetVolume(*vol)),
            _ => None,
        }
    }