Trait lexical_util::constants::FormattedSize

source ·
pub trait FormattedSize {
    const FORMATTED_SIZE: usize;
    const FORMATTED_SIZE_DECIMAL: usize;
}
Expand description

The size, in bytes, of formatted values.

Required Associated Constants§

source

const FORMATTED_SIZE: usize

Maximum number of bytes required to serialize a number to 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.

source

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.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl FormattedSize for f32

source§

impl FormattedSize for f64

source§

impl FormattedSize for i8

source§

impl FormattedSize for i16

source§

impl FormattedSize for i32

source§

impl FormattedSize for i64

source§

impl FormattedSize for i128

source§

impl FormattedSize for isize

source§

impl FormattedSize for u8

source§

impl FormattedSize for u16

source§

impl FormattedSize for u32

source§

impl FormattedSize for u64

source§

impl FormattedSize for u128

source§

impl FormattedSize for usize

Implementors§