use ocpp_types::v16::HeartbeatResponse;
fn main() {
#[cfg(not(feature = "alloc"))]
{
let response: HeartbeatResponse = HeartbeatResponse {
current_time: heapless::String::try_from("2024-01-01T00:00:00Z").unwrap(),
};
println!("default capacity: {}", response.current_time.capacity());
let response: HeartbeatResponse<64> = HeartbeatResponse {
current_time: heapless::String::try_from("2024-01-01T00:00:00Z").unwrap(),
};
println!("chosen capacity: {}", response.current_time.capacity());
}
#[cfg(feature = "alloc")]
{
let response = HeartbeatResponse {
current_time: String::from("2024-01-01T00:00:00Z"),
};
println!("alloc mode, no capacity limit: {}", response.current_time);
}
}