Skip to main content

text_form

Function text_form 

Source
pub fn text_form(value: &Value) -> Result<String, DataError>
Expand description

Returns value’s text form, with a Text, Bytes, Duration or Instant written as a quoted literal.

Reaching a value that is not data is DataError::NotData.

§Errors

DataError::NotData on reaching a value that is not data.

§Panics

When the text cannot be held in memory, as that of a number with an exponent near i64::MAX cannot: a value from outside the program is written with text_form_within instead.