workmn 0.0.5

Manages the lifecycle of projects on the local machine
Documentation
use config::Value;
use std::collections::HashMap;
use std::convert::TryFrom;

#[derive(Debug, Clone)]
pub struct RawTag {
    pub name: String,
    pub value: HashMap<String, Value>,
}

impl TryFrom<(String, Value)> for RawTag {
    type Error = config::ConfigError;

    fn try_from((name, value): (String, Value)) -> Result<Self, Self::Error> {
        Ok(Self {
            name,
            value: value.try_into()?,
        })
    }
}

pub struct TagInfo<'a> {
    raw: &'a RawTag,
}

impl<'a> TagInfo<'a> {
    pub(crate) fn new(raw: &'a RawTag) -> Self {
        Self { raw }
    }

    pub fn name(&self) -> &str {
        &self.raw.name
    }
}