1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
use crate::buffer::Buffer;
use crate::format::Format;
use crate::sealed::Sealed;

/// Marker trait for number types that can be formatted without heap allocation (see [`Buffer`]).
///
/// This trait is sealed; so you may not implement it on your own types.
///
/// [`Buffer`]: struct.Buffer.html
pub trait ToFormattedStr: Sealed {
    #[doc(hidden)]
    fn read_to_buffer<F: Format>(&self, buf: &mut Buffer, format: &F) -> usize;
}