Struct stache::Name
[−]
[src]
pub struct Name { pub base: String, // some fields omitted }
An identifier name generator.
Fields
base: String
Methods
impl Name
[src]
fn new(base: &str) -> Self
Initialize a name generator with a base name. A unique identifier may
then be generated with the next
and to_string
functions.
fn next(&mut self) -> &mut Self
Advances the generator to the next unique identifier. When passing
a Name
through recursive function calls, this can be called before
the next recursion to increment the depth of the generated
identifiers.
impl Name
[src]
fn id(&self) -> String
Creates a valid identifier from the template's short name to be used
in function or variable names generated from this template file:
include/header -> include_header
.