You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
91 lines
61 KiB
91 lines
61 KiB
5 years ago
|
<!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="../../light.css" id="themeStyle"><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="shortcut icon" href="https://www.rust-lang.org/favicon.ico"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></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'><div class='logo-container'><img src='https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png' alt='logo'></div></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.as_array">as_array</a><a href="#method.as_array_mut">as_array_mut</a><a href="#method.as_boolean">as_boolean</a><a href="#method.as_f64">as_f64</a><a href="#method.as_i64">as_i64</a><a href="#method.as_null">as_null</a><a href="#method.as_object">as_object</a><a href="#method.as_object_mut">as_object_mut</a><a href="#method.as_string">as_string</a><a href="#method.as_u64">as_u64</a><a href="#method.find">find</a><a href="#method.find_path">find_path</a><a href="#method.from_reader">from_reader</a><a href="#method.from_str">from_str</a><a href="#method.into_array">into_array</a><a href="#method.into_object">into_object</a><a href="#method.is_array">is_array</a><a href="#method.is_boolean">is_boolean</a><a href="#method.is_f64">is_f64</a><a href="#method.is_i64">is_i64</a><a href="#method.is_null">is_null</a><a href="#method.is_number">is_number</a><a href="#method.is_object">is_object</a><a href="#method.is_string">is_string</a><a href="#method.is_u64">is_u64</a><a href="#method.pretty">pretty</a><a href="#method.search">search</a></div><a class="sidebar-title" href="#implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Clone">Clone</a><a href="#impl-Debug">Debug</a><a href="#impl-Display">Display</a><a href="#impl-Encodable">Encodable</a><a href="#impl-FromStr">FromStr</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-PartialEq%3CJson%3E">PartialEq<Json></a><a href="#impl-PartialOrd%3CJson%3E">PartialOrd<Json></a><a href="#impl-ToJson">ToJson</a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-RefUnwindSafe">RefUnwindSafe</a><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a><a href="#impl-Unpin">Unpin</a><a href="#impl-UnwindSafe">UnwindSafe</a></div><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow<T></a><a href="#impl-BorrowMut%3CT%3E">BorrowMut<T></a><a href="#impl-From%3CT%3E">From<T></a><a href="#impl-Into%3
|
||
|
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><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>
|
||
|
<div id="variant.I64" class="variant small-section-header"><a href="#variant.I64" class="anchor field"></a><code id='I64.v'>I64(<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i64.html">i64</a>)</code></div><div id="variant.U64" class="variant small-section-header"><a href="#variant.U64" class="anchor field"></a><code id='U64.v'>U64(<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u64.html">u64</a>)</code></div><div id="variant.F64" class="variant small-section-header"><a href="#variant.F64" class="anchor field"></a><code id='F64.v'>F64(<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.f64.html">f64</a>)</code></div><div id="variant.String" class="variant small-section-header"><a href="#variant.String" class="anchor field"></a><code id='String.v'>String(<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>)</code></div><div id="variant.Boolean" class="variant small-section-header"><a href="#variant.Boolean" class="anchor field"></a><code id='Boolean.v'>Boolean(<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>)</code></div><div id="variant.Array" class="variant small-section-header"><a href="#variant.Array" class="anchor field"></a><code id='Array.v'>Array(<a class="type" href="../../rustc_serialize/json/type.Array.html" title="type rustc_serialize::json::Array">Array</a>)</code></div><div id="variant.Object" class="variant small-section-header"><a href="#variant.Object" class="anchor field"></a><code id='Object.v'>Object(<a class="type" href="../../rustc_serialize/json/type.Object.html" title="type rustc_serialize::json::Object">Object</a>)</code></div><div id="variant.Null" class="variant small-section-header"><a href="#variant.Null" class="anchor field"></a><code id='Null.v'>Null</code></div><h2 id='methods' class='small-section-header'>Methods<a href='#methods' class='anchor'></a></h2><h3 id='impl' class='impl'><code class='in-band'>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><a class='srclink' href='../../src/rustc_serialize/json.rs.html#957-1200' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from_reader' class="method"><code id='from_reader.v'>pub fn <a href='#method.from_reader' class='fnname'>from_reader</a>(rdr: &mut dyn <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><a class='srclink' href='../../src/rustc_serialize/json.rs.html#959-971' title='goto source code'>[src]</a></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 id='from_str.v'>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><a class='srclink' href='../../src/rustc_serialize/json.rs.html#974-977' title='goto source code'>[src]</a></h4><div class='docblock'><p>Decodes a json value from a string</p>
|
||
|
</div><h4 id='method.pretty' class="method"><code id='pretty.v'>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><a class='srclink' href='../../src/rustc_serialize/json.rs.html#981-983' title='goto source code'>[src]</a></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 id='find.v'>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><a class='srclink' href='../../src/rustc_serialize/json.rs.html#987-992' title='goto source code'>[src]</a></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 id='find_path.v'>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><a class='srclink' href='../../src/rustc_serialize/json.rs.html#997-1006' title='goto source code'>[src]</a></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 id='search.v'>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><a class='srclink' href='../../src/rustc_serialize/json.rs.html#1011-1029' title='goto source code'>[src]</a></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 id='is_object.v'>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><a class='srclink' href='../../src/rustc_serialize/json.rs.html#1032-1034' title='goto source code'>[src]</a></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 id='as_object.v'>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><a class='srclink' href='../../src/rustc_serialize/json.rs.html#1038-1043' title='goto source code'>[src]</a></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"><code id='as_object_mut.v'>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><a class='srclink' href='../../src/rustc_serialize/json.rs.html#1047-1052' title='goto source code'>[src]</a></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"><code id='into_object.v'>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><a class='srclink' href='../../src/rustc_serialize/json.rs.html#1056-1061' title='goto source code'>[src]</a></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"><code id='is_array.v'>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><a class='srclink' href='../../src/rustc_serialize/json.rs.html#1064-1066' title='goto source code'>[src]</a></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 id='as_array.v'>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><a class='srclink' href='../../src/rustc_serialize/json.rs.html#1070-1075' title='goto source code'>[src]</a></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"><code id='as_array_mut.v'>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><a class='srclink' href='../../src/rustc_serialize/json.rs.html#1079-1084' title='goto source code'>[src]</a></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"><code id='into_array.v'>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><a class='srclink' href='../../src/rustc_serialize/json.rs.html#1088-1093' title='goto source code'>[src]</a></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"><code id='is_string.v'>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><a class='srclink' href='../../src/rustc_serialize/json.rs.html#1096-1098' title='goto source code'>[src]</a></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 id='as_string.v'>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><a class='srclink' href='../../src/rustc_serialize/json.rs.html#1102-1107' title='goto source code'>[src]</a></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 id='is_number.v'>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><a class='srclink' href='../../src/rustc_serialize/json.rs.html#1110-1115' title='goto source code'>[src]</a></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 id='is_i64.v'>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><a class='srclink' href='../../src/rustc_serialize/json.rs.html#1118-1123' title='goto source code'>[src]</a></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 id='is_u64.v'>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><a class='srclink' href='../../src/rustc_serialize/json.rs.html#1126-1131' title='goto source code'>[src]</a></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 id='is_f64.v'>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><a class='srclink' href='../../src/rustc_serialize/json.rs.html#1134-1139' title='goto source code'>[src]</a></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 id='as_i64.v'>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><a class='srclink' href='../../src/rustc_serialize/json.rs.html#1143-1150' title='goto source code'>[src]</a></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 id='as_u64.v'>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><a class='srclink' href='../../src/rustc_serialize/json.rs.html#1154-1160' title='goto source code'>[src]</a></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 id='as_f64.v'>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><a class='srclink' href='../../src/rustc_serialize/json.rs.html#1164-1171' title='goto source code'>[src]</a></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 id='is_boolean.v'>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><a class='srclink' href='../../src/rustc_serialize/json.rs.html#1174-1176' title='goto source code'>[src]</a></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 id='as_boolean.v'>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><a class='srclink' href='../../src/rustc_serialize/json.rs.html#1180-1185' title='goto source code'>[src]</a></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 id='is_null.v'>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><a class='srclink' href='../../src/rustc_serialize/json.rs.html#1188-1190' title='goto source code'>[src]</a></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 id='as_null.v'>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><a class='srclink' href='../../src/rustc_serialize/json.rs.html#1194-1199' title='goto source code'>[src]</a></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><div id='implementations-list'><h3 id='impl-Encodable' class='impl'><code class='in-band'>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><a class='srclink' href='../../src/rustc_serialize/json.rs.html#930-943' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.encode' class="method hidden"><code id='encode.v'>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><a class='srclink' href='../../src/rustc_serialize/json.rs.html#931-942' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Serialize a value using an <code>Encoder</code>.</p>
|
||
|
</div></div><h3 id='impl-ToJson' class='impl'><code class='in-band'>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><a class='srclink' href='../../src/rustc_serialize/json.rs.html#2404-2406' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.to_json' class="method hidden"><code id='to_json.v'>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><a class='srclink' href='../../src/rustc_serialize/json.rs.html#2405' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Converts the value of <code>self</code> to an instance of JSON</p>
|
||
|
</div></div><h3 id='impl-Clone' class='impl'><code class='in-band'>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><a class='srclink' href='../../src/rustc_serialize/json.rs.html#260' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.clone' class="method hidden"><code id='clone.v'>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><a class='srclink' href='../../src/rustc_serialize/json.rs.html#260' title='goto source code'>[src]</a></h4><div class='docblock hidden'><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 hidden"><code id='clone_from.v'>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 class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/clone.rs.html#131-133' title='goto source code'>[src]</a></h4><div class='docblock hidden'><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-PartialOrd%3CJson%3E' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html" title="trait core::cmp::PartialOrd">PartialOrd</a><<a class="enum" href="../../rustc_serialize/json/enum.Json.html" title="enum rustc_serialize::json::Json">Json</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%3CJson%3E' class='anchor'></a><a class='srclink' href='../../src/rustc_serialize/json.rs.html#260' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.partial_cmp' class="method hidden"><code id='partial_cmp.v'>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#tymethod.partial_cmp' class='fnname'>partial_cmp</a>(&self, other: &<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><a class='srclink' href='../../src/rustc_serialize/json.rs.html#260' title='goto source code'>[src]</a></h4><div class='docblock hidden'><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 hidden"><code id='lt.v'>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.lt' class='fnname'>lt</a>(&self, other: &<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><a class='srclink' href='../../src/rustc_serialize/json.rs.html#260' title='goto source code'>[src]</a></h4><div class='docblock hidden'><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 hidden"><code id='le.v'>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.le' class='fnname'>le</a>(&self, other: &<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><a class='srclink' href='../../src/rustc_serialize/json.rs.html#260' title='goto source code'>[src]</a></h4><div class='docblock hidden'><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 hidden"><code id='gt.v'>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.gt' class='fnname'>gt</a>(&self, other: &<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><a class='srclink' href='../../src/rustc_serialize/json.rs.html#260' title='goto source code'>[src]</a></h4><div class='docblock hidden'><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 hidden"><code id='ge.v'>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.ge' class='fnname'>ge</a>(&self, other: &<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><a class='srclink' href='../../src/rustc_serialize/json.rs.html#260' title='goto source code'>[src]</a></h4><div class='docblock hidden'><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-PartialEq%3CJson%3E' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html" title="trait core::cmp::PartialEq">PartialEq</a><<a class="enum" href="../../rustc_serialize/json/enum.Json.html" title="enum rustc_serialize::json::Json">Json</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%3CJson%3E' class='anchor'></a><a class='srclink' href='../../src/rustc_serialize/json.rs.html#260' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.eq' class="method hidden"><code id='eq.v'>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq' class='fnname'>eq</a>(&self, other: &<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><a class='srclink' href='../../src/rustc_serialize/json.rs.html#260' title='goto source code'>[src]</a></h4><div class='docblock hidden'><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 hidden"><code id='ne.v'>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&self, other: &<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><a class='srclink' href='../../src/rustc_serialize/json.rs.html#260' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests for <code>!=</code>.</p>
|
||
|
</div></div><h3 id='impl-Index%3C%26%27a%20str%3E' class='impl'><code class='in-band'>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><a class='srclink' href='../../src/rustc_serialize/json.rs.html#1202-1208' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Output' class="type"><code id='Output.t'>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></h4><div class='docblock'><p>The returned type after indexing.</p>
|
||
|
</div><h4 id='method.index' class="method hidden"><code id='index.v'>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><a class='srclink' href='../../src/rustc_serialize/json.rs.html#1205-1207' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the indexing (<code>container[index]</code>) operation.</p>
|
||
|
</div></div><h3 id='impl-Index%3Cusize%3E' class='impl'><code class='in-band'>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><a class='srclink' href='../../src/rustc_serialize/json.rs.html#1210-1219' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Output-1' class="type"><code id='Output.t-1'>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></h4><div class='docblock'><p>The returned type after indexing.</p>
|
||
|
</div><h4 id='method.index-1' class="method hidden"><code id='index.v-1'>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><a class='srclink' href='../../src/rustc_serialize/json.rs.html#1213-1218' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the indexing (<code>container[index]</code>) operation.</p>
|
||
|
</div></div><h3 id='impl-Debug' class='impl'><code class='in-band'>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><a class='srclink' href='../../src/rustc_serialize/json.rs.html#260' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.fmt' class="method hidden"><code id='fmt.v'>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.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><a class='srclink' href='../../src/rustc_serialize/json.rs.html#260' title='goto source code'>[src]</a></h4><div class='docblock hidden'><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-Display' class='impl'><code class='in-band'>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><a class='srclink' href='../../src/rustc_serialize/json.rs.html#2521-2531' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.fmt-1' class="method"><code id='fmt.v-1'>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><a class='srclink' href='../../src/rustc_serialize/json.rs.html#2523-2530' title='goto source code'>[src]</a></h4><div class='docblock'><p>Encodes a json value into a string</p>
|
||
|
</div></div><h3 id='impl-FromStr' class='impl'><code class='in-band'>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><a class='srclink' href='../../src/rustc_serialize/json.rs.html#2581-2586' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Err' class="type"><code id='Err.t'>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></h4><div class='docblock'><p>The associated error which can be returned from parsing.</p>
|
||
|
</div><h4 id='method.from_str-1' class="method hidden"><code id='from_str.v-1'>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><a class='srclink' href='../../src/rustc_serialize/json.rs.html#2583-2585' title='goto source code'>[src]</a></h4><div class='docblock hidden'><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></div><h2 id='synthetic-implementations' class='small-section-header'>Auto Trait Implementations<a href='#synthetic-implementations' class='anchor'></a></h2><div id='synthetic-implementations-list'><h3 id='impl-Send' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="enum" href="../../rustc_serialize/json/enum.Json.html" title="enum rustc_serialize::json::Json">Json</a></code><a href='#impl-Send' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Unpin' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="enum" href="../../rustc_serialize/json/enum.Json.html" title="enum rustc_serialize::json::Json">Json</a></code><a href='#impl-Unpin' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Sync' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="enum" href="../../rustc_serialize/json/enum.Json.html" title="enum rustc_serialize::json::Json">Json</a></code><a href='#impl-Sync' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-UnwindSafe' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a> for <a class="enum" href="../../rustc_serialize/json/enum.Json.html" title="enum rustc_serialize::json::Json">Json</a></code><a href='#impl-UnwindSafe' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-RefUnwindSafe' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a> for <a class="enum" href="../../rustc_serialize/json/enum.Json.html" title="enum rustc_serialize::json::Json">Json</a></code><a href='#impl-RefUnwindSafe' class='anchor'></a></h3><div class='impl-items'></div></div><h2 id='blanket-implementations' class='small-section-header'>Blanket Implementations<a href='#blanket-implementations' class='anchor'></a></h2><div id='blanket-implementations-list'><h3 id='impl-ToOwned' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html" title="trait alloc::borrow::ToOwned">ToOwned</a> for T <span class="where fmt-newline">where<br> T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>, </span></code><a href='#impl-ToOwned' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#81-92' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Owned' class="type"><code id='Owned.t'>type <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#associatedtype.Owned' class="type">Owned</a> = T</code></h4><div class='docblock'><p>The resulting type after obtaining ownership.</p>
|
||
|
</div><h4 id='method.to_owned' class="method hidden"><code id='to_owned.v'>fn <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned' class='fnname'>to_owned</a>(&self) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#85-87' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Creates owned data from borrowed data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned">Read more</a></p>
|
||
|
</div><h4 id='method.clone_into' class="method hidden"><code id='clone_into.v'>fn <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into' class='fnname'>clone_into</a>(&self, target: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T)</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#89-91' title='goto source code'>[src]</a></h4><div class='stability hidden'><div class='stab unstable'><details><summary><span class='emoji'>🔬</span> This is a nightly-only experimental API. (<code>toowned_clone_into</code>)</summary><p>recently added</p>
|
||
|
</details></div></div><div class='docblock hidden'><p>Uses borrowed data to replace owned data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into">Read more</a></p>
|
||
|
</div></div><h3 id='impl-Into%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T>, </span></code><a href='#impl-Into%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#544-549' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.into' class="method hidden"><code id='into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into' class='fnname'>into</a>(self) -> U</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#546-548' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
|
||
|
</div></div><h3 id='impl-From%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> for T</code><a href='#impl-From%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#553-555' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from' class="method hidden"><code id='from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(t: T) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#554' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
|
||
|
</div></div><h3 id='impl-ToString' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/alloc/string/trait.ToString.html" title="trait alloc::string::ToString">ToString</a> for T <span class="where fmt-newline">where<br> T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html" title="trait core::fmt::Display">Display</a> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-ToString' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/string.rs.html#2134-2144' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.to_string' class="method hidden"><code id='to_string.v'>default fn <a href='https://doc.rust-lang.org/nightly/alloc/string/trait.ToString.html#tymethod.to_string' class='fnname'>to_string</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/string.rs.html#2136-2143' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Converts the given value to a <code>String</code>. <a href="https://doc.rust-lang.org/nightly/alloc/string/trait.ToString.html#tymethod.to_string">Read more</a></p>
|
||
|
</div></div><h3 id='impl-TryFrom%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><T>, </span></code><a href='#impl-TryFrom%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#572-578' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error' class="type"><code id='Error.t'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error' class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
|
||
|
</div><h4 id='method.try_from' class="method hidden"><code id='try_from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from' class='fnname'>try_from</a>(value: U) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, <T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#575-577' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
|
||
|
</div></div><h3 id='impl-TryInto%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>, </span></code><a href='#impl-TryInto%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#560-567' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error-1' class="type"><code id='Error.t-1'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error' class="type">Error</a> = <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
|
||
|
</div><h4 id='method.try_into' class="method hidden"><code id='try_into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into' class='fnname'>try_into</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><U, <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#564-566' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
|
||
|
</div></div><h3 id='impl-BorrowMut%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-BorrowMut%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#218-220' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow_mut' class="method hidden"><code id='borrow_mut.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut' class='fnname'>borrow_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#219' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
|
||
|
</div></div><h3 id='impl-Borrow%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Borrow%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#213-215' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow' class="method hidden"><code id='borrow.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow' class='fnname'>borrow</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#214' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
|
||
|
</div></div><h3 id='impl-Any' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br> T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Any' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#100-102' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.type_id' class="method hidden"><code id='type_id.v'>fn <a href='https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id' class='fnname'>type_id</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#101' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
|
||
|
</div></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><p>Search multiple things at once by splitting your query with comma (e.g., <code>str,u8</code> or <code>String,struct:Vec,test</code>)</p></div></div></aside><script>window.rootPath = "../../";window.currentCrate = "rustc_serialize";</script><script src="../../aliases.js"></script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>
|