pub trait FormattedSize {
const FORMATTED_SIZE: usize;
const FORMATTED_SIZE_DECIMAL: usize;
}
write-floats
or write-integers
only.Expand description
The size, in bytes, of formatted values.
Required Associated Constants§
Sourceconst FORMATTED_SIZE: usize
const FORMATTED_SIZE: usize
Maximum number of bytes required to serialize a number to string.
If power-of-two
or radix
is not enabled, this is the same as
FORMATTED_SIZE_DECIMAL
.
Note that this value may be insufficient if digit precision control,
exponent break points, or disabling exponent notation is used. If
you are changing the number significant digits written, the exponent
break points, or disabling scientific notation, you will need a larger
buffer than the one provided. An upper limit on the buffer size can
then be determined using WriteOptions::buffer_size
.
Using an insufficiently large buffer will lead to the code panicking.
Sourceconst FORMATTED_SIZE_DECIMAL: usize
const FORMATTED_SIZE_DECIMAL: usize
Maximum number of bytes required to serialize a number to a decimal string.
Note that this value may be insufficient if digit precision control,
exponent break points, or disabling exponent notation is used. If
you are changing the number significant digits written, the exponent
break points, or disabling scientific notation, you will need a larger
buffer than the one provided. An upper limit on the buffer size can
then be determined using WriteOptions::buffer_size
.
Using an insufficiently large buffer will lead to the code panicking.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.