268 lines
No EOL
50 KiB
HTML
268 lines
No EOL
50 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="../../normalize.css">
|
||
<link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle">
|
||
|
||
<link rel="stylesheet" type="text/css" href="../../dark.css">
|
||
<link rel="stylesheet" type="text/css" href="../../main.css" id="themeStyle">
|
||
<script src="../../storage.js"></script>
|
||
|
||
|
||
<link rel="shortcut icon" href="https://www.rust-lang.org/favicon.ico">
|
||
|
||
</head>
|
||
<body class="rustdoc enum">
|
||
<!--[if lte IE 8]>
|
||
<div class="warning">
|
||
This old browser is unsupported and will most likely display funky
|
||
things.
|
||
</div>
|
||
<![endif]-->
|
||
|
||
|
||
|
||
<nav class="sidebar">
|
||
<div class="sidebar-menu">☰</div>
|
||
<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'>Enum Json</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#variants">Variants</a><div class="sidebar-links"><a href="#variant.I64">I64</a><a href="#variant.U64">U64</a><a href="#variant.F64">F64</a><a href="#variant.String">String</a><a href="#variant.Boolean">Boolean</a><a href="#variant.Array">Array</a><a href="#variant.Object">Object</a><a href="#variant.Null">Null</a></div><a class="sidebar-title" href="#methods">Methods</a><div class="sidebar-links"><a href="#method.from_reader">from_reader</a><a href="#method.from_str">from_str</a><a href="#method.pretty">pretty</a><a href="#method.find">find</a><a href="#method.find_path">find_path</a><a href="#method.search">search</a><a href="#method.is_object">is_object</a><a href="#method.as_object">as_object</a><a href="#method.as_object_mut">as_object_mut</a><a href="#method.into_object">into_object</a><a href="#method.is_array">is_array</a><a href="#method.as_array">as_array</a><a href="#method.as_array_mut">as_array_mut</a><a href="#method.into_array">into_array</a><a href="#method.is_string">is_string</a><a href="#method.as_string">as_string</a><a href="#method.is_number">is_number</a><a href="#method.is_i64">is_i64</a><a href="#method.is_u64">is_u64</a><a href="#method.is_f64">is_f64</a><a href="#method.as_i64">as_i64</a><a href="#method.as_u64">as_u64</a><a href="#method.as_f64">as_f64</a><a href="#method.is_boolean">is_boolean</a><a href="#method.as_boolean">as_boolean</a><a href="#method.is_null">is_null</a><a href="#method.as_null">as_null</a></div><a class="sidebar-title" href="#implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Clone">Clone</a><a href="#impl-PartialEq">PartialEq</a><a href="#impl-PartialOrd">PartialOrd</a><a href="#impl-Debug">Debug</a><a href="#impl-Encodable">Encodable</a><a href="#impl-Index%3C%26%27a%20str%3E">Index<&'a str></a><a href="#impl-Index%3Cusize%3E">Index<usize></a><a href="#impl-ToJson">ToJson</a><a href="#impl-Display">Display</a><a href="#impl-FromStr">FromStr</a></div></div><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></div>
|
||
</nav>
|
||
|
||
<div class="theme-picker">
|
||
<button id="theme-picker" aria-label="Pick another theme!">
|
||
<img src="../../brush.svg" width="18" alt="Pick another theme!">
|
||
</button>
|
||
<div id="theme-choices"></div>
|
||
</div>
|
||
<script src="../../theme.js"></script>
|
||
<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">
|
||
<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 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/alloc/string/struct.String.html" title="struct alloc::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="type rustc_serialize::json::Array">Array</a>),
|
||
Object(<a class="type" href="../../rustc_serialize/json/type.Object.html" title="type rustc_serialize::json::Object">Object</a>),
|
||
Null,
|
||
}</pre><div class='docblock'><p>Represents a json value</p>
|
||
</div><h2 id='variants' class='variants small-section-header'>
|
||
Variants<a href='#variants' class='anchor'></a></h2>
|
||
<span id="variant.I64" class="variant small-section-header"><a href="#variant.I64" class="anchor field"></a><span id='I64.v' class='invisible'><code>I64(<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i64.html">i64</a>)</code></span></span><span id="variant.U64" class="variant small-section-header"><a href="#variant.U64" class="anchor field"></a><span id='U64.v' class='invisible'><code>U64(<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u64.html">u64</a>)</code></span></span><span id="variant.F64" class="variant small-section-header"><a href="#variant.F64" class="anchor field"></a><span id='F64.v' class='invisible'><code>F64(<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.f64.html">f64</a>)</code></span></span><span id="variant.String" class="variant small-section-header"><a href="#variant.String" class="anchor field"></a><span id='String.v' class='invisible'><code>String(<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>)</code></span></span><span id="variant.Boolean" class="variant small-section-header"><a href="#variant.Boolean" class="anchor field"></a><span id='Boolean.v' class='invisible'><code>Boolean(<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>)</code></span></span><span id="variant.Array" class="variant small-section-header"><a href="#variant.Array" class="anchor field"></a><span id='Array.v' class='invisible'><code>Array(<a class="type" href="../../rustc_serialize/json/type.Array.html" title="type rustc_serialize::json::Array">Array</a>)</code></span></span><span id="variant.Object" class="variant small-section-header"><a href="#variant.Object" class="anchor field"></a><span id='Object.v' class='invisible'><code>Object(<a class="type" href="../../rustc_serialize/json/type.Object.html" title="type rustc_serialize::json::Object">Object</a>)</code></span></span><span id="variant.Null" class="variant small-section-header"><a href="#variant.Null" class="anchor field"></a><span id='Null.v' class='invisible'><code>Null</code></span></span>
|
||
<h2 id='methods' class='small-section-header'>
|
||
Methods<a href='#methods' class='anchor'></a>
|
||
</h2>
|
||
<h3 id='impl' class='impl'><span class='in-band'><code>impl <a class="enum" href="../../rustc_serialize/json/enum.Json.html" title="enum rustc_serialize::json::Json">Json</a></code><a href='#impl' class='anchor'></a></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/rustc_serialize/json.rs.html#957-1200' title='goto source code'>[src]</a></span></h3>
|
||
<div class='impl-items'><h4 id='method.from_reader' class="method"><span id='from_reader.v' class='invisible'><code>pub 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="trait std::io::Read">Read</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><Self, <a class="type" href="../../rustc_serialize/json/type.BuilderError.html" title="type rustc_serialize::json::BuilderError">BuilderError</a>></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/rustc_serialize/json.rs.html#959-971' title='goto source code'>[src]</a></span></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"><span id='from_str.v' class='invisible'><code>pub 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="enum core::result::Result">Result</a><Self, <a class="type" href="../../rustc_serialize/json/type.BuilderError.html" title="type rustc_serialize::json::BuilderError">BuilderError</a>></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/rustc_serialize/json.rs.html#974-977' title='goto source code'>[src]</a></span></h4>
|
||
<div class='docblock'><p>Decodes a json value from a string</p>
|
||
</div><h4 id='method.pretty' class="method"><span id='pretty.v' class='invisible'><code>pub fn <a href='#method.pretty' class='fnname'>pretty</a>(&self) -> <a class="struct" href="../../rustc_serialize/json/struct.PrettyJson.html" title="struct rustc_serialize::json::PrettyJson">PrettyJson</a></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/rustc_serialize/json.rs.html#981-983' title='goto source code'>[src]</a></span></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"><span id='find.v' class='invisible'><code>pub 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="enum core::option::Option">Option</a><&'a <a class="enum" href="../../rustc_serialize/json/enum.Json.html" title="enum rustc_serialize::json::Json">Json</a>></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/rustc_serialize/json.rs.html#987-992' title='goto source code'>[src]</a></span></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"><span id='find_path.v' class='invisible'><code>pub 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="enum core::option::Option">Option</a><&'a <a class="enum" href="../../rustc_serialize/json/enum.Json.html" title="enum rustc_serialize::json::Json">Json</a>></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/rustc_serialize/json.rs.html#997-1006' title='goto source code'>[src]</a></span></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"><span id='search.v' class='invisible'><code>pub 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="enum core::option::Option">Option</a><&'a <a class="enum" href="../../rustc_serialize/json/enum.Json.html" title="enum rustc_serialize::json::Json">Json</a>></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/rustc_serialize/json.rs.html#1011-1029' title='goto source code'>[src]</a></span></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"><span id='is_object.v' class='invisible'><code>pub 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></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/rustc_serialize/json.rs.html#1032-1034' title='goto source code'>[src]</a></span></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"><span id='as_object.v' class='invisible'><code>pub 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="enum core::option::Option">Option</a><&'a <a class="type" href="../../rustc_serialize/json/type.Object.html" title="type rustc_serialize::json::Object">Object</a>></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/rustc_serialize/json.rs.html#1038-1043' title='goto source code'>[src]</a></span></h4>
|
||
<div class='docblock'><p>If the Json value is an Object, returns a reference to the associated BTreeMap.
|
||
Returns None otherwise.</p>
|
||
</div><h4 id='method.as_object_mut' class="method"><span id='as_object_mut.v' class='invisible'><code>pub 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="enum core::option::Option">Option</a><&'a mut <a class="type" href="../../rustc_serialize/json/type.Object.html" title="type rustc_serialize::json::Object">Object</a>></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/rustc_serialize/json.rs.html#1047-1052' title='goto source code'>[src]</a></span></h4>
|
||
<div class='docblock'><p>If the Json value is an Object, returns a mutable reference to the associated BTreeMap.
|
||
Returns None otherwise.</p>
|
||
</div><h4 id='method.into_object' class="method"><span id='into_object.v' class='invisible'><code>pub fn <a href='#method.into_object' class='fnname'>into_object</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="type" href="../../rustc_serialize/json/type.Object.html" title="type rustc_serialize::json::Object">Object</a>></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/rustc_serialize/json.rs.html#1056-1061' title='goto source code'>[src]</a></span></h4>
|
||
<div class='docblock'><p>If the Json value is an Object, returns the associated BTreeMap.
|
||
Returns None otherwise.</p>
|
||
</div><h4 id='method.is_array' class="method"><span id='is_array.v' class='invisible'><code>pub 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></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/rustc_serialize/json.rs.html#1064-1066' title='goto source code'>[src]</a></span></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"><span id='as_array.v' class='invisible'><code>pub 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="enum core::option::Option">Option</a><&'a <a class="type" href="../../rustc_serialize/json/type.Array.html" title="type rustc_serialize::json::Array">Array</a>></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/rustc_serialize/json.rs.html#1070-1075' title='goto source code'>[src]</a></span></h4>
|
||
<div class='docblock'><p>If the Json value is an Array, returns a reference to the associated vector.
|
||
Returns None otherwise.</p>
|
||
</div><h4 id='method.as_array_mut' class="method"><span id='as_array_mut.v' class='invisible'><code>pub 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="enum core::option::Option">Option</a><&'a mut <a class="type" href="../../rustc_serialize/json/type.Array.html" title="type rustc_serialize::json::Array">Array</a>></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/rustc_serialize/json.rs.html#1079-1084' title='goto source code'>[src]</a></span></h4>
|
||
<div class='docblock'><p>If the Json value is an Array, returns a mutable reference to the associated vector.
|
||
Returns None otherwise.</p>
|
||
</div><h4 id='method.into_array' class="method"><span id='into_array.v' class='invisible'><code>pub fn <a href='#method.into_array' class='fnname'>into_array</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="type" href="../../rustc_serialize/json/type.Array.html" title="type rustc_serialize::json::Array">Array</a>></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/rustc_serialize/json.rs.html#1088-1093' title='goto source code'>[src]</a></span></h4>
|
||
<div class='docblock'><p>If the Json value is an Array, returns the associated vector.
|
||
Returns None otherwise.</p>
|
||
</div><h4 id='method.is_string' class="method"><span id='is_string.v' class='invisible'><code>pub 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></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/rustc_serialize/json.rs.html#1096-1098' title='goto source code'>[src]</a></span></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"><span id='as_string.v' class='invisible'><code>pub 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="enum core::option::Option">Option</a><&'a <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/rustc_serialize/json.rs.html#1102-1107' title='goto source code'>[src]</a></span></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"><span id='is_number.v' class='invisible'><code>pub 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></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/rustc_serialize/json.rs.html#1110-1115' title='goto source code'>[src]</a></span></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"><span id='is_i64.v' class='invisible'><code>pub 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></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/rustc_serialize/json.rs.html#1118-1123' title='goto source code'>[src]</a></span></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"><span id='is_u64.v' class='invisible'><code>pub 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></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/rustc_serialize/json.rs.html#1126-1131' title='goto source code'>[src]</a></span></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"><span id='is_f64.v' class='invisible'><code>pub 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></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/rustc_serialize/json.rs.html#1134-1139' title='goto source code'>[src]</a></span></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"><span id='as_i64.v' class='invisible'><code>pub 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="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i64.html">i64</a>></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/rustc_serialize/json.rs.html#1143-1150' title='goto source code'>[src]</a></span></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"><span id='as_u64.v' class='invisible'><code>pub 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="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u64.html">u64</a>></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/rustc_serialize/json.rs.html#1154-1160' title='goto source code'>[src]</a></span></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"><span id='as_f64.v' class='invisible'><code>pub 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="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.f64.html">f64</a>></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/rustc_serialize/json.rs.html#1164-1171' title='goto source code'>[src]</a></span></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"><span id='is_boolean.v' class='invisible'><code>pub 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></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/rustc_serialize/json.rs.html#1174-1176' title='goto source code'>[src]</a></span></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"><span id='as_boolean.v' class='invisible'><code>pub 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="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/rustc_serialize/json.rs.html#1180-1185' title='goto source code'>[src]</a></span></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"><span id='is_null.v' class='invisible'><code>pub 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></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/rustc_serialize/json.rs.html#1188-1190' title='goto source code'>[src]</a></span></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"><span id='as_null.v' class='invisible'><code>pub 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="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/rustc_serialize/json.rs.html#1194-1199' title='goto source code'>[src]</a></span></h4>
|
||
<div class='docblock'><p>If the Json value is a Null, returns ().
|
||
Returns None otherwise.</p>
|
||
</div></div>
|
||
<h2 id='implementations' class='small-section-header'>
|
||
Trait Implementations<a href='#implementations' class='anchor'></a>
|
||
</h2>
|
||
<h3 id='impl-Clone' class='impl'><span class='in-band'><code>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> for <a class="enum" href="../../rustc_serialize/json/enum.Json.html" title="enum rustc_serialize::json::Json">Json</a></code><a href='#impl-Clone' class='anchor'></a></span><span class='out-of-band'><div class='ghost'></div><a 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"><span id='clone.v' class='invisible'><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="enum rustc_serialize::json::Json">Json</a></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/rustc_serialize/json.rs.html#260' title='goto source code'>[src]</a></span></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"><span id='clone_from.v' class='invisible'><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: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Self)</code></span><span class='out-of-band'><div class='ghost'></div><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/clone.rs.html#112-114' title='goto source code'>[src]</a></span></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 id='impl-PartialEq' class='impl'><span class='in-band'><code>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html" title="trait core::cmp::PartialEq">PartialEq</a> for <a class="enum" href="../../rustc_serialize/json/enum.Json.html" title="enum rustc_serialize::json::Json">Json</a></code><a href='#impl-PartialEq' class='anchor'></a></span><span class='out-of-band'><div class='ghost'></div><a 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"><span id='eq.v' class='invisible'><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="enum rustc_serialize::json::Json">Json</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/rustc_serialize/json.rs.html#260' title='goto source code'>[src]</a></span></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"><span id='ne.v' class='invisible'><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="enum rustc_serialize::json::Json">Json</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/rustc_serialize/json.rs.html#260' title='goto source code'>[src]</a></span></h4>
|
||
<div class='docblock'><p>This method tests for <code>!=</code>.</p>
|
||
</div></div><h3 id='impl-PartialOrd' class='impl'><span class='in-band'><code>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html" title="trait core::cmp::PartialOrd">PartialOrd</a> for <a class="enum" href="../../rustc_serialize/json/enum.Json.html" title="enum rustc_serialize::json::Json">Json</a></code><a href='#impl-PartialOrd' class='anchor'></a></span><span class='out-of-band'><div class='ghost'></div><a 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"><span id='partial_cmp.v' class='invisible'><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="enum rustc_serialize::json::Json">Json</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/cmp/enum.Ordering.html" title="enum core::cmp::Ordering">Ordering</a>></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/rustc_serialize/json.rs.html#260' title='goto source code'>[src]</a></span></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"><span id='lt.v' class='invisible'><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="enum rustc_serialize::json::Json">Json</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/rustc_serialize/json.rs.html#260' title='goto source code'>[src]</a></span></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"><span id='le.v' class='invisible'><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="enum rustc_serialize::json::Json">Json</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/rustc_serialize/json.rs.html#260' title='goto source code'>[src]</a></span></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"><span id='gt.v' class='invisible'><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="enum rustc_serialize::json::Json">Json</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/rustc_serialize/json.rs.html#260' title='goto source code'>[src]</a></span></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"><span id='ge.v' class='invisible'><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="enum rustc_serialize::json::Json">Json</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/rustc_serialize/json.rs.html#260' title='goto source code'>[src]</a></span></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 id='impl-Debug' class='impl'><span class='in-band'><code>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="enum" href="../../rustc_serialize/json/enum.Json.html" title="enum rustc_serialize::json::Json">Json</a></code><a href='#impl-Debug' class='anchor'></a></span><span class='out-of-band'><div class='ghost'></div><a 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"><span id='fmt.v' class='invisible'><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="struct core::fmt::Formatter">Formatter</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/rustc_serialize/json.rs.html#260' title='goto source code'>[src]</a></span></h4>
|
||
<div class='docblock'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p>
|
||
</div></div><h3 id='impl-Encodable' class='impl'><span class='in-band'><code>impl <a class="trait" href="../../rustc_serialize/trait.Encodable.html" title="trait rustc_serialize::Encodable">Encodable</a> for <a class="enum" href="../../rustc_serialize/json/enum.Json.html" title="enum rustc_serialize::json::Json">Json</a></code><a href='#impl-Encodable' class='anchor'></a></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/rustc_serialize/json.rs.html#930-943' title='goto source code'>[src]</a></span></h3>
|
||
<div class='impl-items'><h4 id='method.encode' class="method"><span id='encode.v' class='invisible'><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="trait rustc_serialize::Encoder">Encoder</a>>(&self, e: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>S) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, S::<a class="type" href="../../rustc_serialize/trait.Encoder.html#associatedtype.Error" title="type rustc_serialize::Encoder::Error">Error</a>></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/rustc_serialize/json.rs.html#931-942' title='goto source code'>[src]</a></span></h4>
|
||
<div class='docblock'><p>Serialize a value using an <code>Encoder</code>.</p>
|
||
</div></div><h3 id='impl-Index%3C%26%27a%20str%3E' class='impl'><span class='in-band'><code>impl<'a> <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/index/trait.Index.html" title="trait core::ops::index::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="enum rustc_serialize::json::Json">Json</a></code><a href='#impl-Index%3C%26%27a%20str%3E' class='anchor'></a></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/rustc_serialize/json.rs.html#1202-1208' title='goto source code'>[src]</a></span></h3>
|
||
<div class='impl-items'><h4 id='associatedtype.Output' class="type"><span id='Output.t' class='invisible'><code>type <a href='https://doc.rust-lang.org/nightly/core/ops/index/trait.Index.html#associatedtype.Output' class="type">Output</a> = <a class="enum" href="../../rustc_serialize/json/enum.Json.html" title="enum rustc_serialize::json::Json">Json</a></code></span></h4>
|
||
<div class='docblock'><p>The returned type after indexing.</p>
|
||
</div><h4 id='method.index' class="method"><span id='index.v' class='invisible'><code>fn <a href='https://doc.rust-lang.org/nightly/core/ops/index/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="enum rustc_serialize::json::Json">Json</a></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/rustc_serialize/json.rs.html#1205-1207' title='goto source code'>[src]</a></span></h4>
|
||
<div class='docblock'><p>Performs the indexing (<code>container[index]</code>) operation.</p>
|
||
</div></div><h3 id='impl-Index%3Cusize%3E' class='impl'><span class='in-band'><code>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/index/trait.Index.html" title="trait core::ops::index::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="enum rustc_serialize::json::Json">Json</a></code><a href='#impl-Index%3Cusize%3E' class='anchor'></a></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/rustc_serialize/json.rs.html#1210-1219' title='goto source code'>[src]</a></span></h3>
|
||
<div class='impl-items'><h4 id='associatedtype.Output-1' class="type"><span id='Output.t-1' class='invisible'><code>type <a href='https://doc.rust-lang.org/nightly/core/ops/index/trait.Index.html#associatedtype.Output' class="type">Output</a> = <a class="enum" href="../../rustc_serialize/json/enum.Json.html" title="enum rustc_serialize::json::Json">Json</a></code></span></h4>
|
||
<div class='docblock'><p>The returned type after indexing.</p>
|
||
</div><h4 id='method.index-1' class="method"><span id='index.v-1' class='invisible'><code>fn <a href='https://doc.rust-lang.org/nightly/core/ops/index/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="enum rustc_serialize::json::Json">Json</a></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/rustc_serialize/json.rs.html#1213-1218' title='goto source code'>[src]</a></span></h4>
|
||
<div class='docblock'><p>Performs the indexing (<code>container[index]</code>) operation.</p>
|
||
</div></div><h3 id='impl-ToJson' class='impl'><span class='in-band'><code>impl <a class="trait" href="../../rustc_serialize/json/trait.ToJson.html" title="trait rustc_serialize::json::ToJson">ToJson</a> for <a class="enum" href="../../rustc_serialize/json/enum.Json.html" title="enum rustc_serialize::json::Json">Json</a></code><a href='#impl-ToJson' class='anchor'></a></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/rustc_serialize/json.rs.html#2404-2406' title='goto source code'>[src]</a></span></h3>
|
||
<div class='impl-items'><h4 id='method.to_json' class="method"><span id='to_json.v' class='invisible'><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="enum rustc_serialize::json::Json">Json</a></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/rustc_serialize/json.rs.html#2405' title='goto source code'>[src]</a></span></h4>
|
||
<div class='docblock'><p>Converts the value of <code>self</code> to an instance of JSON</p>
|
||
</div></div><h3 id='impl-Display' class='impl'><span class='in-band'><code>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html" title="trait core::fmt::Display">Display</a> for <a class="enum" href="../../rustc_serialize/json/enum.Json.html" title="enum rustc_serialize::json::Json">Json</a></code><a href='#impl-Display' class='anchor'></a></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/rustc_serialize/json.rs.html#2521-2531' title='goto source code'>[src]</a></span></h3>
|
||
<div class='impl-items'><h4 id='method.fmt-1' class="method"><span id='fmt.v-1' class='invisible'><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="struct core::fmt::Formatter">Formatter</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/rustc_serialize/json.rs.html#2523-2530' title='goto source code'>[src]</a></span></h4>
|
||
<div class='docblock'><p>Encodes a json value into a string</p>
|
||
</div></div><h3 id='impl-FromStr' class='impl'><span class='in-band'><code>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/str/trait.FromStr.html" title="trait core::str::FromStr">FromStr</a> for <a class="enum" href="../../rustc_serialize/json/enum.Json.html" title="enum rustc_serialize::json::Json">Json</a></code><a href='#impl-FromStr' class='anchor'></a></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/rustc_serialize/json.rs.html#2581-2586' title='goto source code'>[src]</a></span></h3>
|
||
<div class='impl-items'><h4 id='associatedtype.Err' class="type"><span id='Err.t' class='invisible'><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="enum rustc_serialize::json::ParserError">ParserError</a></code></span></h4>
|
||
<div class='docblock'><p>The associated error which can be returned from parsing.</p>
|
||
</div><h4 id='method.from_str-1' class="method"><span id='from_str.v-1' class='invisible'><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="enum core::result::Result">Result</a><<a class="enum" href="../../rustc_serialize/json/enum.Json.html" title="enum rustc_serialize::json::Json">Json</a>, <a class="enum" href="../../rustc_serialize/json/enum.ParserError.html" title="enum rustc_serialize::json::ParserError">ParserError</a>></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/rustc_serialize/json.rs.html#2583-2585' title='goto source code'>[src]</a></span></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><kbd>?</kbd></dt>
|
||
<dd>Show this help dialog</dd>
|
||
<dt><kbd>S</kbd></dt>
|
||
<dd>Focus the search field</dd>
|
||
<dt><kbd>↑</kbd></dt>
|
||
<dd>Move up in search results</dd>
|
||
<dt><kbd>↓</kbd></dt>
|
||
<dd>Move down in search results</dd>
|
||
<dt><kbd>↹</kbd></dt>
|
||
<dd>Switch tab</dd>
|
||
<dt><kbd>⏎</kbd></dt>
|
||
<dd>Go to active search result</dd>
|
||
<dt><kbd>+</kbd></dt>
|
||
<dd>Expand all sections</dd>
|
||
<dt><kbd>-</kbd></dt>
|
||
<dd>Collapse 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";
|
||
</script>
|
||
<script src="../../main.js"></script>
|
||
<script defer src="../../search-index.js"></script>
|
||
</body>
|
||
</html> |