rbatis_codegen/codegen/syntax_tree_pysql/
otherwise_node.rs1use crate::codegen::syntax_tree_pysql::{DefaultName, Name, NodeType, ToHtml};
2
3#[derive(Clone, Debug, Eq, PartialEq)]
18pub struct OtherwiseNode {
19 pub childs: Vec<NodeType>,
20}
21
22impl Name for OtherwiseNode {
23 fn name() -> &'static str {
24 "otherwise"
25 }
26}
27
28impl DefaultName for OtherwiseNode {
29 fn default_name() -> &'static str {
30 "_"
31 }
32}
33
34impl ToHtml for OtherwiseNode {
35 fn as_html(&self) -> String {
36 let mut childs = String::new();
37 for x in &self.childs {
38 childs.push_str(&x.as_html());
39 }
40 format!("<otherwise>{}</otherwise>", childs)
41 }
42}