Function lexical_core::u16toa [−][src]
pub fn u16toa<'a>(value: u16, bytes: &'a mut [u8]) -> &'a mut [u8]
Serializer for a number-to-string conversion using Rust slices.
Returns a subslice of the input buffer containing the written bytes, starting from the same address in memory as the input slice.
If the buffer is not of sufficient size (see the constants
named MAX_*_SIZE
in the lexical_core crate), this function
will panic (and call abort). You must provide a slice
of sufficient length. The data in the slice may be
uninitialized, these values are never read, only written to.
value
- Number to serialize.bytes
- Slice containing a numeric string.
Panics
Panics if the buffer is not of sufficient size, The caller
must provide a slice of sufficient size. In order to ensure
the function will not panic, ensure the buffer has at least
MAX_*_SIZE
elements, using the proper constant for the
serialized type from the lexical_core crate root.