# Trait rustc_serialize::json::ToJson [−] [src]

    pub trait ToJson {
        fn to_json(&self) -> Json;
    }

A trait for converting values to JSON

## Required Methods

### `fn to_json(&self) -> Json`

Converts the value of `self` to an instance of JSON

## Implementors

- `impl ToJson for isize`
- `impl ToJson for i8`
- `impl ToJson for i16`
- `impl ToJson for i32`
- `impl ToJson for i64`
- `impl ToJson for usize`
- `impl ToJson for u8`
- `impl ToJson for u16`
- `impl ToJson for u32`
- `impl ToJson for u64`
- `impl ToJson for Json`
- `impl ToJson for f32`
- `impl ToJson for f64`
- `impl ToJson for ()`
- `impl ToJson for bool`
- `impl ToJson for str`
- `impl ToJson for String`
- `impl<A: ToJson> ToJson for (A,)`
- `impl<A: ToJson, B: ToJson> ToJson for (A, B)`
- `impl<A: ToJson, B: ToJson, C: ToJson> ToJson for (A, B, C)`
- `impl<A: ToJson, B: ToJson, C: ToJson, D: ToJson> ToJson for (A, B, C, D)`
- `impl<A: ToJson, B: ToJson, C: ToJson, D: ToJson, E: ToJson> ToJson for (A, B, C, D, E)`
- `impl<A: ToJson, B: ToJson, C: ToJson, D: ToJson, E: ToJson, F: ToJson> ToJson for (A, B, C, D, E, F)`
- `impl<A: ToJson, B: ToJson, C: ToJson, D: ToJson, E: ToJson, F: ToJson, G: ToJson> ToJson for (A, B, C, D, E, F, G)`
- `impl<A: ToJson, B: ToJson, C: ToJson, D: ToJson, E: ToJson, F: ToJson, G: ToJson, H: ToJson> ToJson for (A, B, C, D, E, F, G, H)`
- `impl<A: ToJson, B: ToJson, C: ToJson, D: ToJson, E: ToJson, F: ToJson, G: ToJson, H: ToJson, I: ToJson> ToJson for (A, B, C, D, E, F, G, H, I)`
- `impl<A: ToJson, B: ToJson, C: ToJson, D: ToJson, E: ToJson, F: ToJson, G: ToJson, H: ToJson, I: ToJson, J: ToJson> ToJson for (A, B, C, D, E, F, G, H, I, J)`
- `impl<A: ToJson, B: ToJson, C: ToJson, D: ToJson, E: ToJson, F: ToJson, G: ToJson, H: ToJson, I: ToJson, J: ToJson, K: ToJson> ToJson for (A, B, C, D, E, F, G, H, I, J, K)`
- `impl<A: ToJson, B: ToJson, C: ToJson, D: ToJson, E: ToJson, F: ToJson, G: ToJson, H: ToJson, I: ToJson, J: ToJson, K: ToJson, L: ToJson> ToJson for (A, B, C, D, E, F, G, H, I, J, K, L)`
- `impl<A: ToJson> ToJson for [A]`
- `impl<A: ToJson> ToJson for Vec<A>`
- `impl<A: ToJson> ToJson for BTreeMap<String, A>`
- `impl<A: ToJson> ToJson for HashMap<String, A>`
- `impl<A: ToJson> ToJson for Option<A>`

# Help

## Keyboard Shortcuts

?
  Show this help dialog
S
  Focus the search field
⇤
  Move up in search results
⇥
  Move down in search results
⏎
  Go to active search result
+
  Collapse/expand all sections

## Search Tricks

Prefix searches with a type followed by a colon (e.g. `fn:`) to restrict the search to a given type.

Accepted types are: `fn`, `mod`, `struct`, `enum`, `trait`, `type`, `macro`, and `const`.

Search functions by type signature (e.g. `vec -> usize` or `* -> vec`)