Expand description
A no-std and no-alloc version of format! using ToArrayString.
§Example
use aformat::{astr, aformat, CapStr};
pub fn say_hello(name: &str, age: u8) {
let name = CapStr::<256>(name);
let formatted = aformat!("Hello {name}, you are {age} years old!");
println!("{}", formatted.as_str());
}
say_hello("Walter White", 50);§Minimum Supported Rust Version
This is currently 1.79, and is considered a breaking change to increase.
Re-exports§
pub use arrayvec::ArrayString;pub use to_arraystring::ToArrayString;
Macros§
- A no-alloc version of
format!, producing anArrayString. aformat!, but you provide your ownArrayString.- A simple and easy way to make a perfectly fitting
ArrayStringfrom a literal.
Structs§
- A transparent wrapper around
&strto truncate the byte length to a compile time constant.