Trait lexical_core::ToLexical[][src]

pub trait ToLexical: Number {
    fn to_lexical<'a>(self, bytes: &'a mut [u8]) -> &'a mut [u8];
}

Trait for numerical types that can be serialized to bytes.

To determine the number of bytes required to serialize a value to string, check the associated constants from a required trait:

Required methods

fn to_lexical<'a>(self, bytes: &'a mut [u8]) -> &'a mut [u8][src]

Serializer for a number-to-string conversion.

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 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 FORMATTED_SIZE_DECIMAL elements.

Loading content...

Implementations on Foreign Types

impl ToLexical for f32[src]

impl ToLexical for f64[src]

impl ToLexical for u8[src]

impl ToLexical for u16[src]

impl ToLexical for u32[src]

impl ToLexical for u64[src]

impl ToLexical for u128[src]

impl ToLexical for usize[src]

impl ToLexical for i8[src]

impl ToLexical for i16[src]

impl ToLexical for i32[src]

impl ToLexical for i64[src]

impl ToLexical for i128[src]

impl ToLexical for isize[src]

Loading content...

Implementors

Loading content...