struct-string-template 0.1.0

Simple string templating language on struct fields
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use thiserror::Error;

#[derive(Error, Debug)]
pub enum TemplateError {
    #[error("Unexpected character \"{character}\" encountered in format string \"{formats}\"")]
    UnexpectedCharacter {
        character: String,
        formats: String,
    },
    #[error("Unexpected end reached in format string \"{formats}\"")]
    UnexpectedEnd {
        formats: String,
    },
    #[error("Unknown selector \"{selector}\"")]
    UnknownSelector {
        selector: String,
    },
}