a fledgling visible library system
Why do I write these weird commit messages....
This commit is contained in:
parent
201e9dc925
commit
89294061b7
7 changed files with 188 additions and 55 deletions
|
@ -6,12 +6,20 @@ use sqlx::{Connection, SqliteConnection};
|
|||
|
||||
use super::kinds::ServiceItemKind;
|
||||
|
||||
#[derive(Debug)]
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct Model<T> {
|
||||
pub items: Vec<T>,
|
||||
pub db: SqliteConnection,
|
||||
pub kind: ServiceItemKind,
|
||||
pub kind: LibraryKind,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
pub enum LibraryKind {
|
||||
Song,
|
||||
Video,
|
||||
Image,
|
||||
Presentation,
|
||||
}
|
||||
|
||||
impl<T> Model<T> {
|
||||
pub fn add_item(&mut self, item: T) -> Result<()> {
|
||||
self.items.push(item);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue