herb 0.10.1

Rust bindings for Herb
Documentation
// NOTE: This file is generated by the templates/template.rb script and should not
// be modified manually. See /home/runner/work/herb/herb/templates/rust/src/config.rs.erb


use std::fmt;

#[derive(Debug, Clone, PartialEq, Eq)]
pub enum Framework {
  Ruby,
  Actionview,
  Hanami,
  Sinatra,
}

impl Default for Framework {
  fn default() -> Self {
    Framework::Ruby
  }
}

impl fmt::Display for Framework {
  fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
    match self {
          Framework::Ruby => write!(f, "ruby"),
          Framework::Actionview => write!(f, "actionview"),
          Framework::Hanami => write!(f, "hanami"),
          Framework::Sinatra => write!(f, "sinatra"),
        }
  }
}

impl Framework {
  pub fn from_str(string: &str) -> Option<Self> {
    match string {
          "ruby" => Some(Framework::Ruby),
          "actionview" => Some(Framework::Actionview),
          "hanami" => Some(Framework::Hanami),
          "sinatra" => Some(Framework::Sinatra),
          _ => None,
    }
  }
}

#[derive(Debug, Clone, PartialEq, Eq)]
pub enum TemplateEngine {
  Erubi,
  Erb,
  Herb,
}

impl Default for TemplateEngine {
  fn default() -> Self {
    TemplateEngine::Erubi
  }
}

impl fmt::Display for TemplateEngine {
  fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
    match self {
          TemplateEngine::Erubi => write!(f, "erubi"),
          TemplateEngine::Erb => write!(f, "erb"),
          TemplateEngine::Herb => write!(f, "herb"),
        }
  }
}

impl TemplateEngine {
  pub fn from_str(string: &str) -> Option<Self> {
    match string {
          "erubi" => Some(TemplateEngine::Erubi),
          "erb" => Some(TemplateEngine::Erb),
          "herb" => Some(TemplateEngine::Herb),
          _ => None,
    }
  }
}