A modern Music Player Daemon based on Rockbox open source high quality audio player
libadwaita audio rust zig deno mpris rockbox mpd
at master 40 lines 814 B view raw
1use async_graphql::*; 2use serde::{Deserialize, Serialize}; 3 4#[derive(Default, Clone, Serialize, Deserialize)] 5pub struct Entry { 6 pub name: String, 7 pub attr: i32, 8 pub time_write: u32, 9 pub customaction: i32, 10} 11 12#[Object] 13impl Entry { 14 async fn name(&self) -> &str { 15 &self.name 16 } 17 18 async fn attr(&self) -> i32 { 19 self.attr 20 } 21 22 async fn time_write(&self) -> u32 { 23 self.time_write 24 } 25 26 async fn customaction(&self) -> i32 { 27 self.customaction 28 } 29} 30 31impl From<rockbox_sys::types::tree::Entry> for Entry { 32 fn from(entry: rockbox_sys::types::tree::Entry) -> Self { 33 Self { 34 name: entry.name, 35 attr: entry.attr, 36 time_write: entry.time_write, 37 customaction: entry.customaction, 38 } 39 } 40}