macro_rules! type_str {
($vis: vis $name: ident = $value: expr $(=> $doc: expr)?) => { ... };
}Expand description
Lifts static strings to type-level strings.
ยงExamples
use refinement_types::type_str;
type_str!(HelloWorld = "Hello, world!");Is equivalent to:
use refinement_types::{StaticStr, TypeStr};
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
struct HelloWorld;
impl TypeStr for HelloWorld {
const VALUE: StaticStr = "Hello, world!";
}