rodo_lib 0.1.2

A Library for a Todo Manager
Documentation
use serde::{Deserialize, Serialize};
use serde_with::serde_as;
use uuid::Uuid;

use crate::utils::RodoStruct;

pub enum FIELDS {
    PATH(String),
}

#[serde_as]
#[derive(Serialize, Deserialize, Clone, Debug)]
/// Struct representing a Path
///
/// * `path`: Path to the Directory or File
pub struct Path {
    path: String,
}

impl Path {
    pub fn new(path: &str) -> (Uuid, Self) {
        (
            Uuid::new_v4(),
            Self {
                path: String::from(path),
            },
        )
    }
}

impl RodoStruct<FIELDS> for Path {
    fn edit(&mut self, fields: FIELDS) {
        match fields {
            FIELDS::PATH(p) => self.path = p,
        }
    }
}