Trait json_api::value::Stringify
[−]
[src]
pub trait Stringify { fn to_bytes(&self) -> Vec<u8>; fn stringify(&self) -> String { ... } }
A specializable version of std::string::ToString
.
Required Methods
fn to_bytes(&self) -> Vec<u8>
Returns the string representation of the give value as a byte vector.
Example
use json_api::value::Stringify; assert_eq!(25.to_bytes(), vec![50, 53]);
Provided Methods
fn stringify(&self) -> String
Returns the string representation of the given value.
Example
use json_api::value::Stringify; assert_eq!(25.stringify(), "25");