239 lines
No EOL
34 KiB
HTML
239 lines
No EOL
34 KiB
HTML
<!DOCTYPE html>
|
||
<html lang="en">
|
||
<head>
|
||
<meta charset="utf-8">
|
||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||
<meta name="generator" content="rustdoc">
|
||
<meta name="description" content="API documentation for the Rust `Json` enum in crate `rustc_serialize`.">
|
||
<meta name="keywords" content="rust, rustlang, rust-lang, Json">
|
||
|
||
<title>rustc_serialize::json::Json - Rust</title>
|
||
|
||
<link rel="stylesheet" type="text/css" href="../../rustdoc.css">
|
||
<link rel="stylesheet" type="text/css" href="../../main.css">
|
||
|
||
|
||
<link rel="shortcut icon" href="https://www.rust-lang.org/favicon.ico">
|
||
|
||
</head>
|
||
<body class="rustdoc">
|
||
<!--[if lte IE 8]>
|
||
<div class="warning">
|
||
This old browser is unsupported and will most likely display funky
|
||
things.
|
||
</div>
|
||
<![endif]-->
|
||
|
||
|
||
|
||
<nav class="sidebar">
|
||
<a href='../../rustc_serialize/index.html'><img src='https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png' alt='logo' width='100'></a>
|
||
<p class='location'><a href='../index.html'>rustc_serialize</a>::<wbr><a href='index.html'>json</a></p><script>window.sidebarCurrent = {name: 'Json', ty: 'enum', relpath: ''};</script><script defer src="sidebar-items.js"></script>
|
||
</nav>
|
||
|
||
<nav class="sub">
|
||
<form class="search-form js-only">
|
||
<div class="search-container">
|
||
<input class="search-input" name="search"
|
||
autocomplete="off"
|
||
placeholder="Click or press ‘S’ to search, ‘?’ for more options…"
|
||
type="search">
|
||
</div>
|
||
</form>
|
||
</nav>
|
||
|
||
<section id='main' class="content enum">
|
||
<h1 class='fqn'><span class='in-band'>Enum <a href='../index.html'>rustc_serialize</a>::<wbr><a href='index.html'>json</a>::<wbr><a class='enum' href=''>Json</a></span><span class='out-of-band'><span id='render-detail'>
|
||
<a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">
|
||
[<span class='inner'>−</span>]
|
||
</a>
|
||
</span><a id='src-5330' class='srclink' href='../../src/rustc_serialize/json.rs.html#261-270' title='goto source code'>[src]</a></span></h1>
|
||
<pre class='rust enum'>pub enum Json {
|
||
I64(<a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.i64.html'>i64</a>),
|
||
U64(<a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.u64.html'>u64</a>),
|
||
F64(<a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.f64.html'>f64</a>),
|
||
String(<a class='struct' href='https://doc.rust-lang.org/nightly/collections/string/struct.String.html' title='collections::string::String'>String</a>),
|
||
Boolean(<a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.bool.html'>bool</a>),
|
||
Array(<a class='type' href='../../rustc_serialize/json/type.Array.html' title='rustc_serialize::json::Array'>Array</a>),
|
||
Object(<a class='type' href='../../rustc_serialize/json/type.Object.html' title='rustc_serialize::json::Object'>Object</a>),
|
||
Null,
|
||
}</pre><div class='docblock'><p>Represents a json value</p>
|
||
</div><h2 class='variants'>Variants</h2>
|
||
<span id='variant.I64' class='variant'><code>I64(<a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.i64.html'>i64</a>)</code></span><span id='variant.U64' class='variant'><code>U64(<a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.u64.html'>u64</a>)</code></span><span id='variant.F64' class='variant'><code>F64(<a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.f64.html'>f64</a>)</code></span><span id='variant.String' class='variant'><code>String(<a class='struct' href='https://doc.rust-lang.org/nightly/collections/string/struct.String.html' title='collections::string::String'>String</a>)</code></span><span id='variant.Boolean' class='variant'><code>Boolean(<a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.bool.html'>bool</a>)</code></span><span id='variant.Array' class='variant'><code>Array(<a class='type' href='../../rustc_serialize/json/type.Array.html' title='rustc_serialize::json::Array'>Array</a>)</code></span><span id='variant.Object' class='variant'><code>Object(<a class='type' href='../../rustc_serialize/json/type.Object.html' title='rustc_serialize::json::Object'>Object</a>)</code></span><span id='variant.Null' class='variant'><code>Null</code></span><h2 id='methods'>Methods</h2><h3 class='impl'><span class='in-band'><code>impl <a class='enum' href='../../rustc_serialize/json/enum.Json.html' title='rustc_serialize::json::Json'>Json</a></code></span><span class='out-of-band'><div class='ghost'></div><a id='src-6053' class='srclink' href='../../src/rustc_serialize/json.rs.html#947-1172' title='goto source code'>[src]</a></span></h3>
|
||
<div class='impl-items'><h4 id='method.from_reader' class='method'><code>fn <a href='#method.from_reader' class='fnname'>from_reader</a>(rdr: &mut <a class='trait' href='https://doc.rust-lang.org/nightly/std/io/trait.Read.html' title='std::io::Read'>Read</a>) -> <a class='enum' href='https://doc.rust-lang.org/nightly/core/result/enum.Result.html' title='core::result::Result'>Result</a><Self, <a class='type' href='../../rustc_serialize/json/type.BuilderError.html' title='rustc_serialize::json::BuilderError'>BuilderError</a>></code></h4>
|
||
<div class='docblock'><p>Decodes a json value from an <code>&mut io::Read</code></p>
|
||
</div><h4 id='method.from_str' class='method'><code>fn <a href='#method.from_str' class='fnname'>from_str</a>(s: &<a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.str.html'>str</a>) -> <a class='enum' href='https://doc.rust-lang.org/nightly/core/result/enum.Result.html' title='core::result::Result'>Result</a><Self, <a class='type' href='../../rustc_serialize/json/type.BuilderError.html' title='rustc_serialize::json::BuilderError'>BuilderError</a>></code></h4>
|
||
<div class='docblock'><p>Decodes a json value from a string</p>
|
||
</div><h4 id='method.pretty' class='method'><code>fn <a href='#method.pretty' class='fnname'>pretty</a>(&self) -> <a class='struct' href='../../rustc_serialize/json/struct.PrettyJson.html' title='rustc_serialize::json::PrettyJson'>PrettyJson</a></code></h4>
|
||
<div class='docblock'><p>Borrow this json object as a pretty object to generate a pretty
|
||
representation for it via <code>Display</code>.</p>
|
||
</div><h4 id='method.find' class='method'><code>fn <a href='#method.find' class='fnname'>find</a><'a>(&'a self, key: &<a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.str.html'>str</a>) -> <a class='enum' href='https://doc.rust-lang.org/nightly/core/option/enum.Option.html' title='core::option::Option'>Option</a><&'a <a class='enum' href='../../rustc_serialize/json/enum.Json.html' title='rustc_serialize::json::Json'>Json</a>></code></h4>
|
||
<div class='docblock'><p>If the Json value is an Object, returns the value associated with the provided key.
|
||
Otherwise, returns None.</p>
|
||
</div><h4 id='method.find_path' class='method'><code>fn <a href='#method.find_path' class='fnname'>find_path</a><'a>(&'a self, keys: <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.slice.html'>&[</a>&<a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.str.html'>str</a><a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.slice.html'>]</a>) -> <a class='enum' href='https://doc.rust-lang.org/nightly/core/option/enum.Option.html' title='core::option::Option'>Option</a><&'a <a class='enum' href='../../rustc_serialize/json/enum.Json.html' title='rustc_serialize::json::Json'>Json</a>></code></h4>
|
||
<div class='docblock'><p>Attempts to get a nested Json Object for each key in <code>keys</code>.
|
||
If any key is found not to exist, find_path will return None.
|
||
Otherwise, it will return the Json value associated with the final key.</p>
|
||
</div><h4 id='method.search' class='method'><code>fn <a href='#method.search' class='fnname'>search</a><'a>(&'a self, key: &<a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.str.html'>str</a>) -> <a class='enum' href='https://doc.rust-lang.org/nightly/core/option/enum.Option.html' title='core::option::Option'>Option</a><&'a <a class='enum' href='../../rustc_serialize/json/enum.Json.html' title='rustc_serialize::json::Json'>Json</a>></code></h4>
|
||
<div class='docblock'><p>If the Json value is an Object, performs a depth-first search until
|
||
a value associated with the provided key is found. If no value is found
|
||
or the Json value is not an Object, returns None.</p>
|
||
</div><h4 id='method.is_object' class='method'><code>fn <a href='#method.is_object' class='fnname'>is_object</a><'a>(&'a self) -> <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.bool.html'>bool</a></code></h4>
|
||
<div class='docblock'><p>Returns true if the Json value is an Object. Returns false otherwise.</p>
|
||
</div><h4 id='method.as_object' class='method'><code>fn <a href='#method.as_object' class='fnname'>as_object</a><'a>(&'a self) -> <a class='enum' href='https://doc.rust-lang.org/nightly/core/option/enum.Option.html' title='core::option::Option'>Option</a><&'a <a class='type' href='../../rustc_serialize/json/type.Object.html' title='rustc_serialize::json::Object'>Object</a>></code></h4>
|
||
<div class='docblock'><p>If the Json value is an Object, returns the associated BTreeMap.
|
||
Returns None otherwise.</p>
|
||
</div><h4 id='method.as_object_mut' class='method'><code>fn <a href='#method.as_object_mut' class='fnname'>as_object_mut</a><'a>(&'a mut self) -> <a class='enum' href='https://doc.rust-lang.org/nightly/core/option/enum.Option.html' title='core::option::Option'>Option</a><&'a mut <a class='type' href='../../rustc_serialize/json/type.Object.html' title='rustc_serialize::json::Object'>Object</a>></code></h4>
|
||
<div class='docblock'><p>If the Json value is an Object, returns the associated mutable BTreeMap.
|
||
Returns None otherwise.</p>
|
||
</div><h4 id='method.is_array' class='method'><code>fn <a href='#method.is_array' class='fnname'>is_array</a><'a>(&'a self) -> <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.bool.html'>bool</a></code></h4>
|
||
<div class='docblock'><p>Returns true if the Json value is an Array. Returns false otherwise.</p>
|
||
</div><h4 id='method.as_array' class='method'><code>fn <a href='#method.as_array' class='fnname'>as_array</a><'a>(&'a self) -> <a class='enum' href='https://doc.rust-lang.org/nightly/core/option/enum.Option.html' title='core::option::Option'>Option</a><&'a <a class='type' href='../../rustc_serialize/json/type.Array.html' title='rustc_serialize::json::Array'>Array</a>></code></h4>
|
||
<div class='docblock'><p>If the Json value is an Array, returns the associated vector.
|
||
Returns None otherwise.</p>
|
||
</div><h4 id='method.as_array_mut' class='method'><code>fn <a href='#method.as_array_mut' class='fnname'>as_array_mut</a><'a>(&'a mut self) -> <a class='enum' href='https://doc.rust-lang.org/nightly/core/option/enum.Option.html' title='core::option::Option'>Option</a><&'a mut <a class='type' href='../../rustc_serialize/json/type.Array.html' title='rustc_serialize::json::Array'>Array</a>></code></h4>
|
||
<div class='docblock'><p>If the Json value is an Array, returns the associated mutable vector.
|
||
Returns None otherwise.</p>
|
||
</div><h4 id='method.is_string' class='method'><code>fn <a href='#method.is_string' class='fnname'>is_string</a><'a>(&'a self) -> <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.bool.html'>bool</a></code></h4>
|
||
<div class='docblock'><p>Returns true if the Json value is a String. Returns false otherwise.</p>
|
||
</div><h4 id='method.as_string' class='method'><code>fn <a href='#method.as_string' class='fnname'>as_string</a><'a>(&'a self) -> <a class='enum' href='https://doc.rust-lang.org/nightly/core/option/enum.Option.html' title='core::option::Option'>Option</a><&'a <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.str.html'>str</a>></code></h4>
|
||
<div class='docblock'><p>If the Json value is a String, returns the associated str.
|
||
Returns None otherwise.</p>
|
||
</div><h4 id='method.is_number' class='method'><code>fn <a href='#method.is_number' class='fnname'>is_number</a>(&self) -> <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.bool.html'>bool</a></code></h4>
|
||
<div class='docblock'><p>Returns true if the Json value is a Number. Returns false otherwise.</p>
|
||
</div><h4 id='method.is_i64' class='method'><code>fn <a href='#method.is_i64' class='fnname'>is_i64</a>(&self) -> <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.bool.html'>bool</a></code></h4>
|
||
<div class='docblock'><p>Returns true if the Json value is a i64. Returns false otherwise.</p>
|
||
</div><h4 id='method.is_u64' class='method'><code>fn <a href='#method.is_u64' class='fnname'>is_u64</a>(&self) -> <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.bool.html'>bool</a></code></h4>
|
||
<div class='docblock'><p>Returns true if the Json value is a u64. Returns false otherwise.</p>
|
||
</div><h4 id='method.is_f64' class='method'><code>fn <a href='#method.is_f64' class='fnname'>is_f64</a>(&self) -> <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.bool.html'>bool</a></code></h4>
|
||
<div class='docblock'><p>Returns true if the Json value is a f64. Returns false otherwise.</p>
|
||
</div><h4 id='method.as_i64' class='method'><code>fn <a href='#method.as_i64' class='fnname'>as_i64</a>(&self) -> <a class='enum' href='https://doc.rust-lang.org/nightly/core/option/enum.Option.html' title='core::option::Option'>Option</a><<a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.i64.html'>i64</a>></code></h4>
|
||
<div class='docblock'><p>If the Json value is a number, return or cast it to a i64.
|
||
Returns None otherwise.</p>
|
||
</div><h4 id='method.as_u64' class='method'><code>fn <a href='#method.as_u64' class='fnname'>as_u64</a>(&self) -> <a class='enum' href='https://doc.rust-lang.org/nightly/core/option/enum.Option.html' title='core::option::Option'>Option</a><<a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.u64.html'>u64</a>></code></h4>
|
||
<div class='docblock'><p>If the Json value is a number, return or cast it to a u64.
|
||
Returns None otherwise.</p>
|
||
</div><h4 id='method.as_f64' class='method'><code>fn <a href='#method.as_f64' class='fnname'>as_f64</a>(&self) -> <a class='enum' href='https://doc.rust-lang.org/nightly/core/option/enum.Option.html' title='core::option::Option'>Option</a><<a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.f64.html'>f64</a>></code></h4>
|
||
<div class='docblock'><p>If the Json value is a number, return or cast it to a f64.
|
||
Returns None otherwise.</p>
|
||
</div><h4 id='method.is_boolean' class='method'><code>fn <a href='#method.is_boolean' class='fnname'>is_boolean</a>(&self) -> <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.bool.html'>bool</a></code></h4>
|
||
<div class='docblock'><p>Returns true if the Json value is a Boolean. Returns false otherwise.</p>
|
||
</div><h4 id='method.as_boolean' class='method'><code>fn <a href='#method.as_boolean' class='fnname'>as_boolean</a>(&self) -> <a class='enum' href='https://doc.rust-lang.org/nightly/core/option/enum.Option.html' title='core::option::Option'>Option</a><<a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.bool.html'>bool</a>></code></h4>
|
||
<div class='docblock'><p>If the Json value is a Boolean, returns the associated bool.
|
||
Returns None otherwise.</p>
|
||
</div><h4 id='method.is_null' class='method'><code>fn <a href='#method.is_null' class='fnname'>is_null</a>(&self) -> <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.bool.html'>bool</a></code></h4>
|
||
<div class='docblock'><p>Returns true if the Json value is a Null. Returns false otherwise.</p>
|
||
</div><h4 id='method.as_null' class='method'><code>fn <a href='#method.as_null' class='fnname'>as_null</a>(&self) -> <a class='enum' href='https://doc.rust-lang.org/nightly/core/option/enum.Option.html' title='core::option::Option'>Option</a><<a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.tuple.html'>()</a>></code></h4>
|
||
<div class='docblock'><p>If the Json value is a Null, returns ().
|
||
Returns None otherwise.</p>
|
||
</div></div><h2 id='implementations'>Trait Implementations</h2><h3 class='impl'><span class='in-band'><code>impl <a class='trait' href='https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html' title='core::fmt::Debug'>Debug</a> for <a class='enum' href='../../rustc_serialize/json/enum.Json.html' title='rustc_serialize::json::Json'>Json</a></code></span><span class='out-of-band'><div class='ghost'></div><a id='src-5159' class='srclink' href='../../src/rustc_serialize/json.rs.html#260' title='goto source code'>[src]</a></span></h3>
|
||
<div class='impl-items'><h4 id='method.fmt' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt' class='fnname'>fmt</a>(&self, __arg_0: &mut <a class='struct' href='https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html' title='core::fmt::Formatter'>Formatter</a>) -> <a class='type' href='https://doc.rust-lang.org/nightly/core/fmt/type.Result.html' title='core::fmt::Result'>Result</a></code></h4>
|
||
<div class='docblock'><p>Formats the value using the given formatter.</p>
|
||
</div></div><h3 class='impl'><span class='in-band'><code>impl <a class='trait' href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html' title='core::cmp::PartialOrd'>PartialOrd</a> for <a class='enum' href='../../rustc_serialize/json/enum.Json.html' title='rustc_serialize::json::Json'>Json</a></code></span><span class='out-of-band'><div class='ghost'></div><a id='src-5178' class='srclink' href='../../src/rustc_serialize/json.rs.html#260' title='goto source code'>[src]</a></span></h3>
|
||
<div class='impl-items'><h4 id='method.partial_cmp' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#tymethod.partial_cmp' class='fnname'>partial_cmp</a>(&self, __arg_0: &<a class='enum' href='../../rustc_serialize/json/enum.Json.html' title='rustc_serialize::json::Json'>Json</a>) -> <a class='enum' href='https://doc.rust-lang.org/nightly/core/option/enum.Option.html' title='core::option::Option'>Option</a><<a class='enum' href='https://doc.rust-lang.org/nightly/core/cmp/enum.Ordering.html' title='core::cmp::Ordering'>Ordering</a>></code></h4>
|
||
<div class='docblock'><p>This method returns an ordering between <code>self</code> and <code>other</code> values if one exists. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#tymethod.partial_cmp">Read more</a></p>
|
||
</div><h4 id='method.lt' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.lt' class='fnname'>lt</a>(&self, __arg_0: &<a class='enum' href='../../rustc_serialize/json/enum.Json.html' title='rustc_serialize::json::Json'>Json</a>) -> <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.bool.html'>bool</a></code></h4>
|
||
<div class='docblock'><p>This method tests less than (for <code>self</code> and <code>other</code>) and is used by the <code><</code> operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.lt">Read more</a></p>
|
||
</div><h4 id='method.le' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.le' class='fnname'>le</a>(&self, __arg_0: &<a class='enum' href='../../rustc_serialize/json/enum.Json.html' title='rustc_serialize::json::Json'>Json</a>) -> <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.bool.html'>bool</a></code></h4>
|
||
<div class='docblock'><p>This method tests less than or equal to (for <code>self</code> and <code>other</code>) and is used by the <code><=</code> operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.le">Read more</a></p>
|
||
</div><h4 id='method.gt' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.gt' class='fnname'>gt</a>(&self, __arg_0: &<a class='enum' href='../../rustc_serialize/json/enum.Json.html' title='rustc_serialize::json::Json'>Json</a>) -> <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.bool.html'>bool</a></code></h4>
|
||
<div class='docblock'><p>This method tests greater than (for <code>self</code> and <code>other</code>) and is used by the <code>></code> operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.gt">Read more</a></p>
|
||
</div><h4 id='method.ge' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.ge' class='fnname'>ge</a>(&self, __arg_0: &<a class='enum' href='../../rustc_serialize/json/enum.Json.html' title='rustc_serialize::json::Json'>Json</a>) -> <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.bool.html'>bool</a></code></h4>
|
||
<div class='docblock'><p>This method tests greater than or equal to (for <code>self</code> and <code>other</code>) and is used by the <code>>=</code> operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.ge">Read more</a></p>
|
||
</div></div><h3 class='impl'><span class='in-band'><code>impl <a class='trait' href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a> for <a class='enum' href='../../rustc_serialize/json/enum.Json.html' title='rustc_serialize::json::Json'>Json</a></code></span><span class='out-of-band'><div class='ghost'></div><a id='src-5281' class='srclink' href='../../src/rustc_serialize/json.rs.html#260' title='goto source code'>[src]</a></span></h3>
|
||
<div class='impl-items'><h4 id='method.eq' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq' class='fnname'>eq</a>(&self, __arg_0: &<a class='enum' href='../../rustc_serialize/json/enum.Json.html' title='rustc_serialize::json::Json'>Json</a>) -> <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.bool.html'>bool</a></code></h4>
|
||
<div class='docblock'><p>This method tests for <code>self</code> and <code>other</code> values to be equal, and is used by <code>==</code>. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq">Read more</a></p>
|
||
</div><h4 id='method.ne' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&self, __arg_0: &<a class='enum' href='../../rustc_serialize/json/enum.Json.html' title='rustc_serialize::json::Json'>Json</a>) -> <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.bool.html'>bool</a></code></h4>
|
||
<div class='docblock'><p>This method tests for <code>!=</code>.</p>
|
||
</div></div><h3 class='impl'><span class='in-band'><code>impl <a class='trait' href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html' title='core::clone::Clone'>Clone</a> for <a class='enum' href='../../rustc_serialize/json/enum.Json.html' title='rustc_serialize::json::Json'>Json</a></code></span><span class='out-of-band'><div class='ghost'></div><a id='src-5320' class='srclink' href='../../src/rustc_serialize/json.rs.html#260' title='goto source code'>[src]</a></span></h3>
|
||
<div class='impl-items'><h4 id='method.clone' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone' class='fnname'>clone</a>(&self) -> <a class='enum' href='../../rustc_serialize/json/enum.Json.html' title='rustc_serialize::json::Json'>Json</a></code></h4>
|
||
<div class='docblock'><p>Returns a copy of the value. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone">Read more</a></p>
|
||
</div><h4 id='method.clone_from' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from' class='fnname'>clone_from</a>(&mut self, source: &Self)</code><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div></h4>
|
||
<div class='docblock'><p>Performs copy-assignment from <code>source</code>. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from">Read more</a></p>
|
||
</div></div><h3 class='impl'><span class='in-band'><code>impl <a class='trait' href='../../rustc_serialize/trait.Encodable.html' title='rustc_serialize::Encodable'>Encodable</a> for <a class='enum' href='../../rustc_serialize/json/enum.Json.html' title='rustc_serialize::json::Json'>Json</a></code></span><span class='out-of-band'><div class='ghost'></div><a id='src-6035' class='srclink' href='../../src/rustc_serialize/json.rs.html#920-933' title='goto source code'>[src]</a></span></h3>
|
||
<div class='impl-items'><h4 id='method.encode' class='method'><code>fn <a href='../../rustc_serialize/trait.Encodable.html#tymethod.encode' class='fnname'>encode</a><S: <a class='trait' href='../../rustc_serialize/trait.Encoder.html' title='rustc_serialize::Encoder'>Encoder</a>>(&self, e: &mut S) -> <a class='enum' href='https://doc.rust-lang.org/nightly/core/result/enum.Result.html' title='core::result::Result'>Result</a><<a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.tuple.html'>()</a>, S::Error></code></h4>
|
||
</div><h3 class='impl'><span class='in-band'><code>impl<'a> <a class='trait' href='https://doc.rust-lang.org/nightly/core/ops/trait.Index.html' title='core::ops::Index'>Index</a><&'a <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.str.html'>str</a>> for <a class='enum' href='../../rustc_serialize/json/enum.Json.html' title='rustc_serialize::json::Json'>Json</a></code></span><span class='out-of-band'><div class='ghost'></div><a id='src-6150' class='srclink' href='../../src/rustc_serialize/json.rs.html#1174-1180' title='goto source code'>[src]</a></span></h3>
|
||
<div class='impl-items'><h4 id='associatedtype.Output' class='type'><code>type <a href='https://doc.rust-lang.org/nightly/core/ops/trait.Index.html#associatedtype.Output' class='type'>Output</a> = <a class='enum' href='../../rustc_serialize/json/enum.Json.html' title='rustc_serialize::json::Json'>Json</a></code></h4>
|
||
<div class='docblock'><p>The returned type after indexing</p>
|
||
</div><h4 id='method.index' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/ops/trait.Index.html#tymethod.index' class='fnname'>index</a>(&self, idx: &<a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.str.html'>str</a>) -> &<a class='enum' href='../../rustc_serialize/json/enum.Json.html' title='rustc_serialize::json::Json'>Json</a></code></h4>
|
||
<div class='docblock'><p>The method for the indexing (<code>Foo[Bar]</code>) operation</p>
|
||
</div></div><h3 class='impl'><span class='in-band'><code>impl <a class='trait' href='https://doc.rust-lang.org/nightly/core/ops/trait.Index.html' title='core::ops::Index'>Index</a><<a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.usize.html'>usize</a>> for <a class='enum' href='../../rustc_serialize/json/enum.Json.html' title='rustc_serialize::json::Json'>Json</a></code></span><span class='out-of-band'><div class='ghost'></div><a id='src-6156' class='srclink' href='../../src/rustc_serialize/json.rs.html#1182-1191' title='goto source code'>[src]</a></span></h3>
|
||
<div class='impl-items'><h4 id='associatedtype.Output-1' class='type'><code>type <a href='https://doc.rust-lang.org/nightly/core/ops/trait.Index.html#associatedtype.Output' class='type'>Output</a> = <a class='enum' href='../../rustc_serialize/json/enum.Json.html' title='rustc_serialize::json::Json'>Json</a></code></h4>
|
||
<div class='docblock'><p>The returned type after indexing</p>
|
||
</div><h4 id='method.index-1' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/ops/trait.Index.html#tymethod.index' class='fnname'>index</a><'a>(&'a self, idx: <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.usize.html'>usize</a>) -> &'a <a class='enum' href='../../rustc_serialize/json/enum.Json.html' title='rustc_serialize::json::Json'>Json</a></code></h4>
|
||
<div class='docblock'><p>The method for the indexing (<code>Foo[Bar]</code>) operation</p>
|
||
</div></div><h3 class='impl'><span class='in-band'><code>impl <a class='trait' href='../../rustc_serialize/json/trait.ToJson.html' title='rustc_serialize::json::ToJson'>ToJson</a> for <a class='enum' href='../../rustc_serialize/json/enum.Json.html' title='rustc_serialize::json::Json'>Json</a></code></span><span class='out-of-band'><div class='ghost'></div><a id='src-7007' class='srclink' href='../../src/rustc_serialize/json.rs.html#2373-2375' title='goto source code'>[src]</a></span></h3>
|
||
<div class='impl-items'><h4 id='method.to_json' class='method'><code>fn <a href='../../rustc_serialize/json/trait.ToJson.html#tymethod.to_json' class='fnname'>to_json</a>(&self) -> <a class='enum' href='../../rustc_serialize/json/enum.Json.html' title='rustc_serialize::json::Json'>Json</a></code></h4>
|
||
<div class='docblock'><p>Converts the value of <code>self</code> to an instance of JSON</p>
|
||
</div></div><h3 class='impl'><span class='in-band'><code>impl <a class='trait' href='https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html' title='core::fmt::Display'>Display</a> for <a class='enum' href='../../rustc_serialize/json/enum.Json.html' title='rustc_serialize::json::Json'>Json</a></code></span><span class='out-of-band'><div class='ghost'></div><a id='src-7265' class='srclink' href='../../src/rustc_serialize/json.rs.html#2490-2500' title='goto source code'>[src]</a></span></h3>
|
||
<div class='impl-items'><h4 id='method.fmt-1' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html#tymethod.fmt' class='fnname'>fmt</a>(&self, f: &mut <a class='struct' href='https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html' title='core::fmt::Formatter'>Formatter</a>) -> <a class='type' href='https://doc.rust-lang.org/nightly/core/fmt/type.Result.html' title='core::fmt::Result'>Result</a></code></h4>
|
||
<div class='docblock'><p>Encodes a json value into a string</p>
|
||
</div></div><h3 class='impl'><span class='in-band'><code>impl <a class='trait' href='https://doc.rust-lang.org/nightly/core/str/trait.FromStr.html' title='core::str::FromStr'>FromStr</a> for <a class='enum' href='../../rustc_serialize/json/enum.Json.html' title='rustc_serialize::json::Json'>Json</a></code></span><span class='out-of-band'><div class='ghost'></div><a id='src-7301' class='srclink' href='../../src/rustc_serialize/json.rs.html#2550-2555' title='goto source code'>[src]</a></span></h3>
|
||
<div class='impl-items'><h4 id='associatedtype.Err' class='type'><code>type <a href='https://doc.rust-lang.org/nightly/core/str/trait.FromStr.html#associatedtype.Err' class='type'>Err</a> = <a class='enum' href='../../rustc_serialize/json/enum.ParserError.html' title='rustc_serialize::json::ParserError'>ParserError</a></code></h4>
|
||
<div class='docblock'><p>The associated error which can be returned from parsing.</p>
|
||
</div><h4 id='method.from_str-1' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/str/trait.FromStr.html#tymethod.from_str' class='fnname'>from_str</a>(s: &<a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.str.html'>str</a>) -> <a class='enum' href='https://doc.rust-lang.org/nightly/core/result/enum.Result.html' title='core::result::Result'>Result</a><<a class='enum' href='../../rustc_serialize/json/enum.Json.html' title='rustc_serialize::json::Json'>Json</a>, <a class='enum' href='../../rustc_serialize/json/enum.ParserError.html' title='rustc_serialize::json::ParserError'>ParserError</a>></code></h4>
|
||
<div class='docblock'><p>Parses a string <code>s</code> to return a value of this type. <a href="https://doc.rust-lang.org/nightly/core/str/trait.FromStr.html#tymethod.from_str">Read more</a></p>
|
||
</div></div></section>
|
||
<section id='search' class="content hidden"></section>
|
||
|
||
<section class="footer"></section>
|
||
|
||
<aside id="help" class="hidden">
|
||
<div>
|
||
<h1 class="hidden">Help</h1>
|
||
|
||
<div class="shortcuts">
|
||
<h2>Keyboard Shortcuts</h2>
|
||
|
||
<dl>
|
||
<dt>?</dt>
|
||
<dd>Show this help dialog</dd>
|
||
<dt>S</dt>
|
||
<dd>Focus the search field</dd>
|
||
<dt>⇤</dt>
|
||
<dd>Move up in search results</dd>
|
||
<dt>⇥</dt>
|
||
<dd>Move down in search results</dd>
|
||
<dt>⏎</dt>
|
||
<dd>Go to active search result</dd>
|
||
<dt>+</dt>
|
||
<dd>Collapse/expand all sections</dd>
|
||
</dl>
|
||
</div>
|
||
|
||
<div class="infos">
|
||
<h2>Search Tricks</h2>
|
||
|
||
<p>
|
||
Prefix searches with a type followed by a colon (e.g.
|
||
<code>fn:</code>) to restrict the search to a given type.
|
||
</p>
|
||
|
||
<p>
|
||
Accepted types are: <code>fn</code>, <code>mod</code>,
|
||
<code>struct</code>, <code>enum</code>,
|
||
<code>trait</code>, <code>type</code>, <code>macro</code>,
|
||
and <code>const</code>.
|
||
</p>
|
||
|
||
<p>
|
||
Search functions by type signature (e.g.
|
||
<code>vec -> usize</code> or <code>* -> vec</code>)
|
||
</p>
|
||
</div>
|
||
</div>
|
||
</aside>
|
||
|
||
|
||
|
||
<script>
|
||
window.rootPath = "../../";
|
||
window.currentCrate = "rustc_serialize";
|
||
window.playgroundUrl = "";
|
||
</script>
|
||
<script src="../../jquery.js"></script>
|
||
<script src="../../main.js"></script>
|
||
|
||
<script defer src="../../search-index.js"></script>
|
||
</body>
|
||
</html> |