Function std::num::strconv::int_to_str_bytes_commonDeprecated[src]
pub fn int_to_str_bytes_common<T: Int>(num: T, radix: uint, sign: SignFormat, f: |u8|)
Converts an integral number to its string representation as a byte vector.
This is meant to be a common base implementation for all integral string
conversion functions like to_str() or to_str_radix().
Arguments
num- The number to convert. Accepts any number that implements the numeric traits.radix- Base to use. Accepts only the values 2-36.sign- How to emit the sign. Options are:SignNone: No sign at all. Basically emitsabs(num).SignNeg: Only-on negative values.SignAll: Both+on positive, and-on negative numbers.
f- a callback which will be invoked for each ascii character which composes the string representation of this integer
Return value
A tuple containing the byte vector, and a boolean flag indicating
whether it represents a special value like inf, -inf, NaN or not.
It returns a tuple because there can be ambiguity between a special value
and a number representation at higher bases.
Failure
- Fails if
radix< 2 orradix> 36.