pub trait ToTxt {
// Required method
fn to_txt(&self) -> Txt;
}
Expand description
A trait for converting a value to a Txt
.
This trait is automatically implemented for any type which implements the ToString
trait.
You can use formatx!
to format!
a text.
Converts the given value to an owned Txt
.
§Examples
Basic usage:
use zng_txt::*;
let expected = formatx!("10");
let actual = 10.to_txt();
assert_eq!(expected, actual);