num_format/to_formatted_str.rs
1use crate::buffer::Buffer;
2use crate::format::Format;
3use crate::sealed::Sealed;
4
5/// Marker trait for number types that can be formatted without heap allocation (see [`Buffer`]).
6///
7/// This trait is sealed; so you may not implement it on your own types.
8///
9/// [`Buffer`]: struct.Buffer.html
10pub trait ToFormattedStr: Sealed + Sized {
11 #[doc(hidden)]
12 fn read_to_buffer<F>(&self, buf: &mut Buffer, format: &F) -> usize
13 where
14 F: Format;
15}