mage 0.2.0

An intuitive and powerful template engine.
Documentation

use serde_json::Value;


pub trait Render {
    fn render(&self) -> String;
}

impl Render for Value {
    fn render(&self) -> String {
        match *self {
            Value::Number(ref n) => n.to_string(),
            Value::String(ref f) => f.to_owned(),
            Value::Bool(ref f) => f.to_string(),
            Value::Null => String::new(),
            Value::Array(ref f) => format!("{:?}", f),
            Value::Object(ref f) => format!("{:?}", f),
        }
    }
}