[][src]Struct json_in_type::JSON

pub struct JSON<T: JSONValue>(pub T);

Encapsulates a JSONValue and implements useful traits.

Examples

use json_in_type::JSON;

let x_json = JSON(vec![(), (), ()]);
assert_eq!("[null,null,null]", x_json.to_string()); // JSON format

println!("{}", x_json); // just works. Displays [null,null,null]

let my_buffer : Vec<u8> = x_json.into();
assert_eq!(b"[null,null,null]".to_vec(), my_buffer);

Trait Implementations

impl<T: JSONValue> From<JSON<T>> for Vec<u8>[src]

impl<T: JSONValue> Display for JSON<T>[src]

Auto Trait Implementations

impl<T> Send for JSON<T> where
    T: Send

impl<T> Sync for JSON<T> where
    T: Sync

Blanket Implementations

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized
[src]