Function lexical_core::write[][src]

pub fn write<'a, N: ToLexical>(n: N, bytes: &'a mut [u8]) -> &'a mut [u8]

Write number to string.

Returns a subslice of the input buffer containing the written bytes, starting from the same address in memory as the input slice.

  • value - Number to serialize.
  • bytes - Slice containing a numeric string.

Panics

Panics if the buffer may not be large enough to hold the serialized number. In order to ensure the function will not panic, provide a buffer with at least FORMATTED_SIZE_DECIMAL elements.