Enum extra::json::Json

pub enum Json {
    Number(float),
    String(~str),
    Boolean(bool),
    List(List),
    Object(~Object),
    Null,
}

Represents a json value

Methods

impl Json

fn to_writer(&self, wr: @std::io::Writer)

Encodes a json value into a io::writer. Uses a single line.

fn to_pretty_writer(&self, wr: @std::io::Writer)

Encodes a json value into a io::writer. Pretty-prints in a more readable format.

fn to_pretty_str(&self) -> ~str

Encodes a json value into a string

Trait Implementations

impl std::clone::Clone for Json

fn clone(&self) -> Json

impl std::cmp::Eq for Json

fn eq(&self, __arg_0: &Json) -> bool

fn ne(&self, __arg_0: &Json) -> bool

impl<E: Encoder> Encodable<E> for Json

fn encode(&self, e: &mut E)

impl std::cmp::Ord for Json

fn lt(&self, other: &Json) -> bool

impl ToJson for Json

fn to_json(&self) -> Json

Converts the value of self to an instance of JSON

impl std::to_str::ToStr for Json

fn to_str(&self) -> ~str

Encodes a json value into a string