| 1 |
<!DOCTYPE html> |
| 2 |
<html lang="en"> |
| 3 |
<head> |
| 4 |
<meta charset="utf-8"> |
| 5 |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> |
| 6 |
<meta name="generator" content="rustdoc"> |
| 7 |
<meta name="description" content="API documentation for the Rust `Vec` struct in crate `collections`."> |
| 8 |
<meta name="keywords" content="rust, rustlang, rust-lang, Vec"> |
| 9 |
|
| 10 |
<title>collections::vec::Vec - Rust</title> |
| 11 |
|
| 12 |
<link rel="stylesheet" type="text/css" href="../../main.css"> |
| 13 |
|
| 14 |
<link rel="shortcut icon" href="http://www.rust-lang.org/favicon.ico"> |
| 15 |
|
| 16 |
</head> |
| 17 |
<body class="rustdoc"> |
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
<section class="sidebar"> |
| 28 |
<a href='../../collections/index.html'><img src='http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png' alt='' width='100'></a> |
| 29 |
<p class='location'><a href='../index.html'>collections</a>::<wbr><a href='index.html'>vec</a></p><script>window.sidebarCurrent = {name: 'Vec', ty: 'struct', relpath: ''};</script><script defer src="sidebar-items.js"></script> |
| 30 |
</section> |
| 31 |
|
| 32 |
<nav class="sub"> |
| 33 |
<form class="search-form js-only"> |
| 34 |
<div class="search-container"> |
| 35 |
<input class="search-input" name="search" |
| 36 |
autocomplete="off" |
| 37 |
placeholder="Click or press 'S' to search, '?' for more options..." |
| 38 |
type="search"> |
| 39 |
</div> |
| 40 |
</form> |
| 41 |
</nav> |
| 42 |
|
| 43 |
<section id='main' class="content struct"> |
| 44 |
<h1 class='fqn'><span class='in-band'>Struct <a href='../index.html'>collections</a>::<wbr><a href='index.html'>vec</a>::<wbr><a class='struct' href=''>Vec</a></span><span class='out-of-band'><span id='render-detail'> |
| 45 |
<a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs"> |
| 46 |
[<span class='inner'>−</span>] |
| 47 |
</a> |
| 48 |
</span><a id='src-29946' class='srclink' href='../../src/collections/vec.rs.html#154-158' title='goto source code'>[src]</a></span></h1> |
| 49 |
<pre class='rust struct'>pub struct Vec<T> { |
| 50 |
// some fields omitted |
| 51 |
}</pre><div class='docblock'><p>A growable list type, written <code>Vec<T></code> but pronounced 'vector.'</p> |
| 52 |
|
| 53 |
<h1 id="examples" class='section-header'><a |
| 54 |
href="#examples">Examples</a></h1><span class='rusttest'>#![feature(collections)] |
| 55 |
extern crate collections; |
| 56 |
fn main() { |
| 57 |
let mut vec = Vec::new(); |
| 58 |
vec.push(1); |
| 59 |
vec.push(2); |
| 60 |
|
| 61 |
assert_eq!(vec.len(), 2); |
| 62 |
assert_eq!(vec[0], 1); |
| 63 |
|
| 64 |
assert_eq!(vec.pop(), Some(2)); |
| 65 |
assert_eq!(vec.len(), 1); |
| 66 |
|
| 67 |
vec[0] = 7; |
| 68 |
assert_eq!(vec[0], 7); |
| 69 |
|
| 70 |
vec.push_all(&[1, 2, 3]); |
| 71 |
|
| 72 |
for x in vec.iter() { |
| 73 |
println!("{}", x); |
| 74 |
} |
| 75 |
assert_eq!(vec, [7, 1, 2, 3]); |
| 76 |
|
| 77 |
}</span><pre id='rust-example-rendered' class='rust '> |
| 78 |
<span class='kw'>let</span> <span class='kw-2'>mut</span> <span class='ident'>vec</span> <span class='op'>=</span> <span class='ident'>Vec</span>::<span class='ident'>new</span>(); |
| 79 |
<span class='ident'>vec</span>.<span class='ident'>push</span>(<span class='number'>1</span>); |
| 80 |
<span class='ident'>vec</span>.<span class='ident'>push</span>(<span class='number'>2</span>); |
| 81 |
|
| 82 |
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>vec</span>.<span class='ident'>len</span>(), <span class='number'>2</span>); |
| 83 |
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>vec</span>[<span class='number'>0</span>], <span class='number'>1</span>); |
| 84 |
|
| 85 |
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>vec</span>.<span class='ident'>pop</span>(), <span class='prelude-val'>Some</span>(<span class='number'>2</span>)); |
| 86 |
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>vec</span>.<span class='ident'>len</span>(), <span class='number'>1</span>); |
| 87 |
|
| 88 |
<span class='ident'>vec</span>[<span class='number'>0</span>] <span class='op'>=</span> <span class='number'>7</span>; |
| 89 |
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>vec</span>[<span class='number'>0</span>], <span class='number'>7</span>); |
| 90 |
|
| 91 |
<span class='ident'>vec</span>.<span class='ident'>push_all</span>(<span class='kw-2'>&</span>[<span class='number'>1</span>, <span class='number'>2</span>, <span class='number'>3</span>]); |
| 92 |
|
| 93 |
<span class='kw'>for</span> <span class='ident'>x</span> <span class='kw'>in</span> <span class='ident'>vec</span>.<span class='ident'>iter</span>() { |
| 94 |
<span class='macro'>println</span><span class='macro'>!</span>(<span class='string'>"{}"</span>, <span class='ident'>x</span>); |
| 95 |
} |
| 96 |
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>vec</span>, [<span class='number'>7</span>, <span class='number'>1</span>, <span class='number'>2</span>, <span class='number'>3</span>]); |
| 97 |
</pre> |
| 98 |
|
| 99 |
<p>The <code>vec!</code> macro is provided to make initialization more convenient:</p> |
| 100 |
<span class='rusttest'>fn main() { |
| 101 |
let mut vec = vec![1, 2, 3]; |
| 102 |
vec.push(4); |
| 103 |
assert_eq!(vec, [1, 2, 3, 4]); |
| 104 |
|
| 105 |
}</span><pre id='rust-example-rendered' class='rust '> |
| 106 |
<span class='kw'>let</span> <span class='kw-2'>mut</span> <span class='ident'>vec</span> <span class='op'>=</span> <span class='macro'>vec</span><span class='macro'>!</span>[<span class='number'>1</span>, <span class='number'>2</span>, <span class='number'>3</span>]; |
| 107 |
<span class='ident'>vec</span>.<span class='ident'>push</span>(<span class='number'>4</span>); |
| 108 |
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>vec</span>, [<span class='number'>1</span>, <span class='number'>2</span>, <span class='number'>3</span>, <span class='number'>4</span>]); |
| 109 |
</pre> |
| 110 |
|
| 111 |
<p>Use a <code>Vec<T></code> as an efficient stack:</p> |
| 112 |
<span class='rusttest'>fn main() { |
| 113 |
let mut stack = Vec::new(); |
| 114 |
|
| 115 |
stack.push(1); |
| 116 |
stack.push(2); |
| 117 |
stack.push(3); |
| 118 |
|
| 119 |
while let Some(top) = stack.pop() { |
| 120 |
// Prints 3, 2, 1 |
| 121 |
println!("{}", top); |
| 122 |
} |
| 123 |
|
| 124 |
}</span><pre id='rust-example-rendered' class='rust '> |
| 125 |
<span class='kw'>let</span> <span class='kw-2'>mut</span> <span class='ident'>stack</span> <span class='op'>=</span> <span class='ident'>Vec</span>::<span class='ident'>new</span>(); |
| 126 |
|
| 127 |
<span class='ident'>stack</span>.<span class='ident'>push</span>(<span class='number'>1</span>); |
| 128 |
<span class='ident'>stack</span>.<span class='ident'>push</span>(<span class='number'>2</span>); |
| 129 |
<span class='ident'>stack</span>.<span class='ident'>push</span>(<span class='number'>3</span>); |
| 130 |
|
| 131 |
<span class='kw'>while</span> <span class='kw'>let</span> <span class='prelude-val'>Some</span>(<span class='ident'>top</span>) <span class='op'>=</span> <span class='ident'>stack</span>.<span class='ident'>pop</span>() { |
| 132 |
<span class='comment'>// Prints 3, 2, 1</span> |
| 133 |
<span class='macro'>println</span><span class='macro'>!</span>(<span class='string'>"{}"</span>, <span class='ident'>top</span>); |
| 134 |
} |
| 135 |
</pre> |
| 136 |
|
| 137 |
<h1 id="capacity-and-reallocation" class='section-header'><a |
| 138 |
href="#capacity-and-reallocation">Capacity and reallocation</a></h1> |
| 139 |
<p>The capacity of a vector is the amount of space allocated for any future |
| 140 |
elements that will be added onto the vector. This is not to be confused with |
| 141 |
the <em>length</em> of a vector, which specifies the number of actual elements |
| 142 |
within the vector. If a vector's length exceeds its capacity, its capacity |
| 143 |
will automatically be increased, but its elements will have to be |
| 144 |
reallocated.</p> |
| 145 |
|
| 146 |
<p>For example, a vector with capacity 10 and length 0 would be an empty vector |
| 147 |
with space for 10 more elements. Pushing 10 or fewer elements onto the |
| 148 |
vector will not change its capacity or cause reallocation to occur. However, |
| 149 |
if the vector's length is increased to 11, it will have to reallocate, which |
| 150 |
can be slow. For this reason, it is recommended to use <code>Vec::with_capacity</code> |
| 151 |
whenever possible to specify how big the vector is expected to get.</p> |
| 152 |
</div><h2 id='methods'>Methods</h2><h3 class='impl'><code>impl<T> <a class='struct' href='../../collections/vec/struct.Vec.html' title='collections::vec::Vec'>Vec</a><T></code></h3><div class='impl-items'><h4 id='method.new' class='method'><code>fn <a href='#method.new' class='fnname'>new</a>() -> <a class='struct' href='../../collections/vec/struct.Vec.html' title='collections::vec::Vec'>Vec</a><T></code></h4> |
| 153 |
<div class='docblock'><p>Constructs a new, empty <code>Vec<T></code>.</p> |
| 154 |
|
| 155 |
<p>The vector will not allocate until elements are pushed onto it.</p> |
| 156 |
|
| 157 |
<h1 id="examples" class='section-header'><a |
| 158 |
href="#examples">Examples</a></h1><span class='rusttest'>fn main() { |
| 159 |
let mut vec: Vec<i32> = Vec::new(); |
| 160 |
|
| 161 |
}</span><pre id='rust-example-rendered' class='rust '> |
| 162 |
<span class='kw'>let</span> <span class='kw-2'>mut</span> <span class='ident'>vec</span>: <span class='ident'>Vec</span><span class='op'><</span><span class='ident'>i32</span><span class='op'>></span> <span class='op'>=</span> <span class='ident'>Vec</span>::<span class='ident'>new</span>(); |
| 163 |
</pre> |
| 164 |
</div><h4 id='method.with_capacity' class='method'><code>fn <a href='#method.with_capacity' class='fnname'>with_capacity</a>(capacity: <a href='../../core/primitive.usize.html'>usize</a>) -> <a class='struct' href='../../collections/vec/struct.Vec.html' title='collections::vec::Vec'>Vec</a><T></code></h4> |
| 165 |
<div class='docblock'><p>Constructs a new, empty <code>Vec<T></code> with the specified capacity.</p> |
| 166 |
|
| 167 |
<p>The vector will be able to hold exactly <code>capacity</code> elements without reallocating. If |
| 168 |
<code>capacity</code> is 0, the vector will not allocate.</p> |
| 169 |
|
| 170 |
<p>It is important to note that this function does not specify the <em>length</em> of the returned |
| 171 |
vector, but only the <em>capacity</em>. (For an explanation of the difference between length and |
| 172 |
capacity, see the main <code>Vec<T></code> docs above, 'Capacity and reallocation'.)</p> |
| 173 |
|
| 174 |
<h1 id="examples" class='section-header'><a |
| 175 |
href="#examples">Examples</a></h1><span class='rusttest'>fn main() { |
| 176 |
let mut vec = Vec::with_capacity(10); |
| 177 |
|
| 178 |
// The vector contains no items, even though it has capacity for more |
| 179 |
assert_eq!(vec.len(), 0); |
| 180 |
|
| 181 |
// These are all done without reallocating... |
| 182 |
for i in 0..10 { |
| 183 |
vec.push(i); |
| 184 |
} |
| 185 |
|
| 186 |
// ...but this may make the vector reallocate |
| 187 |
vec.push(11); |
| 188 |
|
| 189 |
}</span><pre id='rust-example-rendered' class='rust '> |
| 190 |
<span class='kw'>let</span> <span class='kw-2'>mut</span> <span class='ident'>vec</span> <span class='op'>=</span> <span class='ident'>Vec</span>::<span class='ident'>with_capacity</span>(<span class='number'>10</span>); |
| 191 |
|
| 192 |
<span class='comment'>// The vector contains no items, even though it has capacity for more</span> |
| 193 |
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>vec</span>.<span class='ident'>len</span>(), <span class='number'>0</span>); |
| 194 |
|
| 195 |
<span class='comment'>// These are all done without reallocating...</span> |
| 196 |
<span class='kw'>for</span> <span class='ident'>i</span> <span class='kw'>in</span> <span class='number'>0</span>..<span class='number'>10</span> { |
| 197 |
<span class='ident'>vec</span>.<span class='ident'>push</span>(<span class='ident'>i</span>); |
| 198 |
} |
| 199 |
|
| 200 |
<span class='comment'>// ...but this may make the vector reallocate</span> |
| 201 |
<span class='ident'>vec</span>.<span class='ident'>push</span>(<span class='number'>11</span>); |
| 202 |
</pre> |
| 203 |
</div><h4 id='method.from_raw_parts' class='method'><code>unsafe fn <a href='#method.from_raw_parts' class='fnname'>from_raw_parts</a>(ptr: <a href='../../core/primitive.pointer.html'>*mut T</a>, length: <a href='../../core/primitive.usize.html'>usize</a>, capacity: <a href='../../core/primitive.usize.html'>usize</a>) -> <a class='struct' href='../../collections/vec/struct.Vec.html' title='collections::vec::Vec'>Vec</a><T></code></h4> |
| 204 |
<div class='docblock'><p>Creates a <code>Vec<T></code> directly from the raw components of another vector.</p> |
| 205 |
|
| 206 |
<p>This is highly unsafe, due to the number of invariants that aren't checked.</p> |
| 207 |
|
| 208 |
<h1 id="examples" class='section-header'><a |
| 209 |
href="#examples">Examples</a></h1><span class='rusttest'>use std::ptr; |
| 210 |
use std::mem; |
| 211 |
|
| 212 |
fn main() { |
| 213 |
let mut v = vec![1, 2, 3]; |
| 214 |
|
| 215 |
// Pull out the various important pieces of information about `v` |
| 216 |
let p = v.as_mut_ptr(); |
| 217 |
let len = v.len(); |
| 218 |
let cap = v.capacity(); |
| 219 |
|
| 220 |
unsafe { |
| 221 |
// Cast `v` into the void: no destructor run, so we are in |
| 222 |
// complete control of the allocation to which `p` points. |
| 223 |
mem::forget(v); |
| 224 |
|
| 225 |
// Overwrite memory with 4, 5, 6 |
| 226 |
for i in 0..len as isize { |
| 227 |
ptr::write(p.offset(i), 4 + i); |
| 228 |
} |
| 229 |
|
| 230 |
// Put everything back together into a Vec |
| 231 |
let rebuilt = Vec::from_raw_parts(p, len, cap); |
| 232 |
assert_eq!(rebuilt, [4, 5, 6]); |
| 233 |
} |
| 234 |
} |
| 235 |
</span><pre id='rust-example-rendered' class='rust '> |
| 236 |
<span class='kw'>use</span> <span class='ident'>std</span>::<span class='ident'>ptr</span>; |
| 237 |
<span class='kw'>use</span> <span class='ident'>std</span>::<span class='ident'>mem</span>; |
| 238 |
|
| 239 |
<span class='kw'>fn</span> <span class='ident'>main</span>() { |
| 240 |
<span class='kw'>let</span> <span class='kw-2'>mut</span> <span class='ident'>v</span> <span class='op'>=</span> <span class='macro'>vec</span><span class='macro'>!</span>[<span class='number'>1</span>, <span class='number'>2</span>, <span class='number'>3</span>]; |
| 241 |
|
| 242 |
<span class='comment'>// Pull out the various important pieces of information about `v`</span> |
| 243 |
<span class='kw'>let</span> <span class='ident'>p</span> <span class='op'>=</span> <span class='ident'>v</span>.<span class='ident'>as_mut_ptr</span>(); |
| 244 |
<span class='kw'>let</span> <span class='ident'>len</span> <span class='op'>=</span> <span class='ident'>v</span>.<span class='ident'>len</span>(); |
| 245 |
<span class='kw'>let</span> <span class='ident'>cap</span> <span class='op'>=</span> <span class='ident'>v</span>.<span class='ident'>capacity</span>(); |
| 246 |
|
| 247 |
<span class='kw'>unsafe</span> { |
| 248 |
<span class='comment'>// Cast `v` into the void: no destructor run, so we are in</span> |
| 249 |
<span class='comment'>// complete control of the allocation to which `p` points.</span> |
| 250 |
<span class='ident'>mem</span>::<span class='ident'>forget</span>(<span class='ident'>v</span>); |
| 251 |
|
| 252 |
<span class='comment'>// Overwrite memory with 4, 5, 6</span> |
| 253 |
<span class='kw'>for</span> <span class='ident'>i</span> <span class='kw'>in</span> <span class='number'>0</span>..<span class='ident'>len</span> <span class='kw'>as</span> <span class='ident'>isize</span> { |
| 254 |
<span class='ident'>ptr</span>::<span class='ident'>write</span>(<span class='ident'>p</span>.<span class='ident'>offset</span>(<span class='ident'>i</span>), <span class='number'>4</span> <span class='op'>+</span> <span class='ident'>i</span>); |
| 255 |
} |
| 256 |
|
| 257 |
<span class='comment'>// Put everything back together into a Vec</span> |
| 258 |
<span class='kw'>let</span> <span class='ident'>rebuilt</span> <span class='op'>=</span> <span class='ident'>Vec</span>::<span class='ident'>from_raw_parts</span>(<span class='ident'>p</span>, <span class='ident'>len</span>, <span class='ident'>cap</span>); |
| 259 |
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>rebuilt</span>, [<span class='number'>4</span>, <span class='number'>5</span>, <span class='number'>6</span>]); |
| 260 |
} |
| 261 |
} |
| 262 |
</pre> |
| 263 |
</div><h4 id='method.from_raw_buf' class='method'><code>unsafe fn <a href='#method.from_raw_buf' class='fnname'>from_raw_buf</a>(ptr: <a href='../../core/primitive.pointer.html'>*const T</a>, elts: <a href='../../core/primitive.usize.html'>usize</a>) -> <a class='struct' href='../../collections/vec/struct.Vec.html' title='collections::vec::Vec'>Vec</a><T></code></h4> |
| 264 |
<div class='stability'><em class='stab unstable'>Unstable<p>: may be better expressed via composition</p> |
| 265 |
</em></div><div class='docblock'><p>Creates a vector by copying the elements from a raw pointer.</p> |
| 266 |
|
| 267 |
<p>This function will copy <code>elts</code> contiguous elements starting at <code>ptr</code> |
| 268 |
into a new allocation owned by the returned <code>Vec<T></code>. The elements of |
| 269 |
the buffer are copied into the vector without cloning, as if |
| 270 |
<code>ptr::read()</code> were called on them.</p> |
| 271 |
</div><h4 id='method.capacity' class='method'><code>fn <a href='#method.capacity' class='fnname'>capacity</a>(&self) -> <a href='../../core/primitive.usize.html'>usize</a></code></h4> |
| 272 |
<div class='docblock'><p>Returns the number of elements the vector can hold without |
| 273 |
reallocating.</p> |
| 274 |
|
| 275 |
<h1 id="examples" class='section-header'><a |
| 276 |
href="#examples">Examples</a></h1><span class='rusttest'>fn main() { |
| 277 |
let vec: Vec<i32> = Vec::with_capacity(10); |
| 278 |
assert_eq!(vec.capacity(), 10); |
| 279 |
|
| 280 |
}</span><pre id='rust-example-rendered' class='rust '> |
| 281 |
<span class='kw'>let</span> <span class='ident'>vec</span>: <span class='ident'>Vec</span><span class='op'><</span><span class='ident'>i32</span><span class='op'>></span> <span class='op'>=</span> <span class='ident'>Vec</span>::<span class='ident'>with_capacity</span>(<span class='number'>10</span>); |
| 282 |
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>vec</span>.<span class='ident'>capacity</span>(), <span class='number'>10</span>); |
| 283 |
</pre> |
| 284 |
</div><h4 id='method.reserve' class='method'><code>fn <a href='#method.reserve' class='fnname'>reserve</a>(&mut self, additional: <a href='../../core/primitive.usize.html'>usize</a>)</code></h4> |
| 285 |
<div class='docblock'><p>Reserves capacity for at least <code>additional</code> more elements to be inserted |
| 286 |
in the given <code>Vec<T></code>. The collection may reserve more space to avoid |
| 287 |
frequent reallocations.</p> |
| 288 |
|
| 289 |
<h1 id="panics" class='section-header'><a |
| 290 |
href="#panics">Panics</a></h1> |
| 291 |
<p>Panics if the new capacity overflows <code>usize</code>.</p> |
| 292 |
|
| 293 |
<h1 id="examples" class='section-header'><a |
| 294 |
href="#examples">Examples</a></h1><span class='rusttest'>fn main() { |
| 295 |
let mut vec = vec![1]; |
| 296 |
vec.reserve(10); |
| 297 |
assert!(vec.capacity() >= 11); |
| 298 |
|
| 299 |
}</span><pre id='rust-example-rendered' class='rust '> |
| 300 |
<span class='kw'>let</span> <span class='kw-2'>mut</span> <span class='ident'>vec</span> <span class='op'>=</span> <span class='macro'>vec</span><span class='macro'>!</span>[<span class='number'>1</span>]; |
| 301 |
<span class='ident'>vec</span>.<span class='ident'>reserve</span>(<span class='number'>10</span>); |
| 302 |
<span class='macro'>assert</span><span class='macro'>!</span>(<span class='ident'>vec</span>.<span class='ident'>capacity</span>() <span class='op'>>=</span> <span class='number'>11</span>); |
| 303 |
</pre> |
| 304 |
</div><h4 id='method.reserve_exact' class='method'><code>fn <a href='#method.reserve_exact' class='fnname'>reserve_exact</a>(&mut self, additional: <a href='../../core/primitive.usize.html'>usize</a>)</code></h4> |
| 305 |
<div class='docblock'><p>Reserves the minimum capacity for exactly <code>additional</code> more elements to |
| 306 |
be inserted in the given <code>Vec<T></code>. Does nothing if the capacity is already |
| 307 |
sufficient.</p> |
| 308 |
|
| 309 |
<p>Note that the allocator may give the collection more space than it |
| 310 |
requests. Therefore capacity can not be relied upon to be precisely |
| 311 |
minimal. Prefer <code>reserve</code> if future insertions are expected.</p> |
| 312 |
|
| 313 |
<h1 id="panics" class='section-header'><a |
| 314 |
href="#panics">Panics</a></h1> |
| 315 |
<p>Panics if the new capacity overflows <code>usize</code>.</p> |
| 316 |
|
| 317 |
<h1 id="examples" class='section-header'><a |
| 318 |
href="#examples">Examples</a></h1><span class='rusttest'>fn main() { |
| 319 |
let mut vec = vec![1]; |
| 320 |
vec.reserve_exact(10); |
| 321 |
assert!(vec.capacity() >= 11); |
| 322 |
|
| 323 |
}</span><pre id='rust-example-rendered' class='rust '> |
| 324 |
<span class='kw'>let</span> <span class='kw-2'>mut</span> <span class='ident'>vec</span> <span class='op'>=</span> <span class='macro'>vec</span><span class='macro'>!</span>[<span class='number'>1</span>]; |
| 325 |
<span class='ident'>vec</span>.<span class='ident'>reserve_exact</span>(<span class='number'>10</span>); |
| 326 |
<span class='macro'>assert</span><span class='macro'>!</span>(<span class='ident'>vec</span>.<span class='ident'>capacity</span>() <span class='op'>>=</span> <span class='number'>11</span>); |
| 327 |
</pre> |
| 328 |
</div><h4 id='method.shrink_to_fit' class='method'><code>fn <a href='#method.shrink_to_fit' class='fnname'>shrink_to_fit</a>(&mut self)</code></h4> |
| 329 |
<div class='docblock'><p>Shrinks the capacity of the vector as much as possible.</p> |
| 330 |
|
| 331 |
<p>It will drop down as close as possible to the length but the allocator |
| 332 |
may still inform the vector that there is space for a few more elements.</p> |
| 333 |
|
| 334 |
<h1 id="examples" class='section-header'><a |
| 335 |
href="#examples">Examples</a></h1><span class='rusttest'>#![feature(collections)] |
| 336 |
extern crate collections; |
| 337 |
fn main() { |
| 338 |
let mut vec = Vec::with_capacity(10); |
| 339 |
vec.push_all(&[1, 2, 3]); |
| 340 |
assert_eq!(vec.capacity(), 10); |
| 341 |
vec.shrink_to_fit(); |
| 342 |
assert!(vec.capacity() >= 3); |
| 343 |
|
| 344 |
}</span><pre id='rust-example-rendered' class='rust '> |
| 345 |
<span class='kw'>let</span> <span class='kw-2'>mut</span> <span class='ident'>vec</span> <span class='op'>=</span> <span class='ident'>Vec</span>::<span class='ident'>with_capacity</span>(<span class='number'>10</span>); |
| 346 |
<span class='ident'>vec</span>.<span class='ident'>push_all</span>(<span class='kw-2'>&</span>[<span class='number'>1</span>, <span class='number'>2</span>, <span class='number'>3</span>]); |
| 347 |
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>vec</span>.<span class='ident'>capacity</span>(), <span class='number'>10</span>); |
| 348 |
<span class='ident'>vec</span>.<span class='ident'>shrink_to_fit</span>(); |
| 349 |
<span class='macro'>assert</span><span class='macro'>!</span>(<span class='ident'>vec</span>.<span class='ident'>capacity</span>() <span class='op'>>=</span> <span class='number'>3</span>); |
| 350 |
</pre> |
| 351 |
</div><h4 id='method.into_boxed_slice' class='method'><code>fn <a href='#method.into_boxed_slice' class='fnname'>into_boxed_slice</a>(self) -> <a class='struct' href='../../collections/boxed/struct.Box.html' title='collections::boxed::Box'>Box</a><<a href='../primitive.slice.html'>[T]</a>></code></h4> |
| 352 |
<div class='docblock'><p>Converts the vector into Box<[T]>.</p> |
| 353 |
|
| 354 |
<p>Note that this will drop any excess capacity. Calling this and |
| 355 |
converting back to a vector with <code>into_vec()</code> is equivalent to calling |
| 356 |
<code>shrink_to_fit()</code>.</p> |
| 357 |
</div><h4 id='method.truncate' class='method'><code>fn <a href='#method.truncate' class='fnname'>truncate</a>(&mut self, len: <a href='../../core/primitive.usize.html'>usize</a>)</code></h4> |
| 358 |
<div class='docblock'><p>Shorten a vector, dropping excess elements.</p> |
| 359 |
|
| 360 |
<p>If <code>len</code> is greater than the vector's current length, this has no |
| 361 |
effect.</p> |
| 362 |
|
| 363 |
<h1 id="examples" class='section-header'><a |
| 364 |
href="#examples">Examples</a></h1><span class='rusttest'>#![feature(collections)] |
| 365 |
extern crate collections; |
| 366 |
fn main() { |
| 367 |
let mut vec = vec![1, 2, 3, 4]; |
| 368 |
vec.truncate(2); |
| 369 |
assert_eq!(vec, [1, 2]); |
| 370 |
|
| 371 |
}</span><pre id='rust-example-rendered' class='rust '> |
| 372 |
<span class='kw'>let</span> <span class='kw-2'>mut</span> <span class='ident'>vec</span> <span class='op'>=</span> <span class='macro'>vec</span><span class='macro'>!</span>[<span class='number'>1</span>, <span class='number'>2</span>, <span class='number'>3</span>, <span class='number'>4</span>]; |
| 373 |
<span class='ident'>vec</span>.<span class='ident'>truncate</span>(<span class='number'>2</span>); |
| 374 |
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>vec</span>, [<span class='number'>1</span>, <span class='number'>2</span>]); |
| 375 |
</pre> |
| 376 |
</div><h4 id='method.as_slice' class='method'><code>fn <a href='#method.as_slice' class='fnname'>as_slice</a>(&self) -> <a href='../primitive.slice.html'>&[T]</a></code></h4> |
| 377 |
<div class='stability'><em class='stab unstable'>Unstable<p>: waiting on RFC revision</p> |
| 378 |
</em></div><div class='docblock'><p>Extracts a slice containing the entire vector.</p> |
| 379 |
</div><h4 id='method.as_mut_slice' class='method'><code>fn <a href='#method.as_mut_slice' class='fnname'>as_mut_slice</a>(&mut self) -> <a href='../primitive.slice.html'>&mut [T]</a></code></h4> |
| 380 |
<div class='stability'><em class='stab unstable'>Unstable<p>: waiting on RFC revision</p> |
| 381 |
</em></div><div class='docblock'><p>Deprecated: use <code>&mut s[..]</code> instead.</p> |
| 382 |
</div><h4 id='method.set_len' class='method'><code>unsafe fn <a href='#method.set_len' class='fnname'>set_len</a>(&mut self, len: <a href='../../core/primitive.usize.html'>usize</a>)</code></h4> |
| 383 |
<div class='docblock'><p>Sets the length of a vector.</p> |
| 384 |
|
| 385 |
<p>This will explicitly set the size of the vector, without actually |
| 386 |
modifying its buffers, so it is up to the caller to ensure that the |
| 387 |
vector is actually the specified size.</p> |
| 388 |
|
| 389 |
<h1 id="examples" class='section-header'><a |
| 390 |
href="#examples">Examples</a></h1><span class='rusttest'>fn main() { |
| 391 |
let mut v = vec![1, 2, 3, 4]; |
| 392 |
unsafe { |
| 393 |
v.set_len(1); |
| 394 |
} |
| 395 |
|
| 396 |
}</span><pre id='rust-example-rendered' class='rust '> |
| 397 |
<span class='kw'>let</span> <span class='kw-2'>mut</span> <span class='ident'>v</span> <span class='op'>=</span> <span class='macro'>vec</span><span class='macro'>!</span>[<span class='number'>1</span>, <span class='number'>2</span>, <span class='number'>3</span>, <span class='number'>4</span>]; |
| 398 |
<span class='kw'>unsafe</span> { |
| 399 |
<span class='ident'>v</span>.<span class='ident'>set_len</span>(<span class='number'>1</span>); |
| 400 |
} |
| 401 |
</pre> |
| 402 |
</div><h4 id='method.swap_remove' class='method'><code>fn <a href='#method.swap_remove' class='fnname'>swap_remove</a>(&mut self, index: <a href='../../core/primitive.usize.html'>usize</a>) -> T</code></h4> |
| 403 |
<div class='docblock'><p>Removes an element from anywhere in the vector and return it, replacing |
| 404 |
it with the last element.</p> |
| 405 |
|
| 406 |
<p>This does not preserve ordering, but is O(1).</p> |
| 407 |
|
| 408 |
<h1 id="panics" class='section-header'><a |
| 409 |
href="#panics">Panics</a></h1> |
| 410 |
<p>Panics if <code>index</code> is out of bounds.</p> |
| 411 |
|
| 412 |
<h1 id="examples" class='section-header'><a |
| 413 |
href="#examples">Examples</a></h1><span class='rusttest'>fn main() { |
| 414 |
let mut v = vec!["foo", "bar", "baz", "qux"]; |
| 415 |
|
| 416 |
assert_eq!(v.swap_remove(1), "bar"); |
| 417 |
assert_eq!(v, ["foo", "qux", "baz"]); |
| 418 |
|
| 419 |
assert_eq!(v.swap_remove(0), "foo"); |
| 420 |
assert_eq!(v, ["baz", "qux"]); |
| 421 |
|
| 422 |
}</span><pre id='rust-example-rendered' class='rust '> |
| 423 |
<span class='kw'>let</span> <span class='kw-2'>mut</span> <span class='ident'>v</span> <span class='op'>=</span> <span class='macro'>vec</span><span class='macro'>!</span>[<span class='string'>"foo"</span>, <span class='string'>"bar"</span>, <span class='string'>"baz"</span>, <span class='string'>"qux"</span>]; |
| 424 |
|
| 425 |
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>v</span>.<span class='ident'>swap_remove</span>(<span class='number'>1</span>), <span class='string'>"bar"</span>); |
| 426 |
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>v</span>, [<span class='string'>"foo"</span>, <span class='string'>"qux"</span>, <span class='string'>"baz"</span>]); |
| 427 |
|
| 428 |
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>v</span>.<span class='ident'>swap_remove</span>(<span class='number'>0</span>), <span class='string'>"foo"</span>); |
| 429 |
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>v</span>, [<span class='string'>"baz"</span>, <span class='string'>"qux"</span>]); |
| 430 |
</pre> |
| 431 |
</div><h4 id='method.insert' class='method'><code>fn <a href='#method.insert' class='fnname'>insert</a>(&mut self, index: <a href='../../core/primitive.usize.html'>usize</a>, element: T)</code></h4> |
| 432 |
<div class='docblock'><p>Inserts an element at position <code>index</code> within the vector, shifting all |
| 433 |
elements after position <code>i</code> one position to the right.</p> |
| 434 |
|
| 435 |
<h1 id="panics" class='section-header'><a |
| 436 |
href="#panics">Panics</a></h1> |
| 437 |
<p>Panics if <code>index</code> is greater than the vector's length.</p> |
| 438 |
|
| 439 |
<h1 id="examples" class='section-header'><a |
| 440 |
href="#examples">Examples</a></h1><span class='rusttest'>fn main() { |
| 441 |
let mut vec = vec![1, 2, 3]; |
| 442 |
vec.insert(1, 4); |
| 443 |
assert_eq!(vec, [1, 4, 2, 3]); |
| 444 |
vec.insert(4, 5); |
| 445 |
assert_eq!(vec, [1, 4, 2, 3, 5]); |
| 446 |
|
| 447 |
}</span><pre id='rust-example-rendered' class='rust '> |
| 448 |
<span class='kw'>let</span> <span class='kw-2'>mut</span> <span class='ident'>vec</span> <span class='op'>=</span> <span class='macro'>vec</span><span class='macro'>!</span>[<span class='number'>1</span>, <span class='number'>2</span>, <span class='number'>3</span>]; |
| 449 |
<span class='ident'>vec</span>.<span class='ident'>insert</span>(<span class='number'>1</span>, <span class='number'>4</span>); |
| 450 |
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>vec</span>, [<span class='number'>1</span>, <span class='number'>4</span>, <span class='number'>2</span>, <span class='number'>3</span>]); |
| 451 |
<span class='ident'>vec</span>.<span class='ident'>insert</span>(<span class='number'>4</span>, <span class='number'>5</span>); |
| 452 |
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>vec</span>, [<span class='number'>1</span>, <span class='number'>4</span>, <span class='number'>2</span>, <span class='number'>3</span>, <span class='number'>5</span>]); |
| 453 |
</pre> |
| 454 |
</div><h4 id='method.remove' class='method'><code>fn <a href='#method.remove' class='fnname'>remove</a>(&mut self, index: <a href='../../core/primitive.usize.html'>usize</a>) -> T</code></h4> |
| 455 |
<div class='docblock'><p>Removes and returns the element at position <code>index</code> within the vector, |
| 456 |
shifting all elements after position <code>index</code> one position to the left.</p> |
| 457 |
|
| 458 |
<h1 id="panics" class='section-header'><a |
| 459 |
href="#panics">Panics</a></h1> |
| 460 |
<p>Panics if <code>index</code> is out of bounds.</p> |
| 461 |
|
| 462 |
<h1 id="examples" class='section-header'><a |
| 463 |
href="#examples">Examples</a></h1><span class='rusttest'>#![feature(collections)] |
| 464 |
extern crate collections; |
| 465 |
fn main() { |
| 466 |
let mut v = vec![1, 2, 3]; |
| 467 |
assert_eq!(v.remove(1), 2); |
| 468 |
assert_eq!(v, [1, 3]); |
| 469 |
|
| 470 |
}</span><pre id='rust-example-rendered' class='rust '> |
| 471 |
<span class='kw'>let</span> <span class='kw-2'>mut</span> <span class='ident'>v</span> <span class='op'>=</span> <span class='macro'>vec</span><span class='macro'>!</span>[<span class='number'>1</span>, <span class='number'>2</span>, <span class='number'>3</span>]; |
| 472 |
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>v</span>.<span class='ident'>remove</span>(<span class='number'>1</span>), <span class='number'>2</span>); |
| 473 |
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>v</span>, [<span class='number'>1</span>, <span class='number'>3</span>]); |
| 474 |
</pre> |
| 475 |
</div><h4 id='method.retain' class='method'><code>fn <a href='#method.retain' class='fnname'>retain</a><F>(&mut self, f: F) <span class='where'>where F: <a class='trait' href='../../core/ops/trait.FnMut.html' title='core::ops::FnMut'>FnMut</a>(&T) -> <a href='../../core/primitive.bool.html'>bool</a></span></code></h4> |
| 476 |
<div class='docblock'><p>Retains only the elements specified by the predicate.</p> |
| 477 |
|
| 478 |
<p>In other words, remove all elements <code>e</code> such that <code>f(&e)</code> returns false. |
| 479 |
This method operates in place and preserves the order of the retained |
| 480 |
elements.</p> |
| 481 |
|
| 482 |
<h1 id="examples" class='section-header'><a |
| 483 |
href="#examples">Examples</a></h1><span class='rusttest'>fn main() { |
| 484 |
let mut vec = vec![1, 2, 3, 4]; |
| 485 |
vec.retain(|&x| x%2 == 0); |
| 486 |
assert_eq!(vec, [2, 4]); |
| 487 |
|
| 488 |
}</span><pre id='rust-example-rendered' class='rust '> |
| 489 |
<span class='kw'>let</span> <span class='kw-2'>mut</span> <span class='ident'>vec</span> <span class='op'>=</span> <span class='macro'>vec</span><span class='macro'>!</span>[<span class='number'>1</span>, <span class='number'>2</span>, <span class='number'>3</span>, <span class='number'>4</span>]; |
| 490 |
<span class='ident'>vec</span>.<span class='ident'>retain</span>(<span class='op'>|</span><span class='kw-2'>&</span><span class='ident'>x</span><span class='op'>|</span> <span class='ident'>x</span><span class='op'>%</span><span class='number'>2</span> <span class='op'>==</span> <span class='number'>0</span>); |
| 491 |
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>vec</span>, [<span class='number'>2</span>, <span class='number'>4</span>]); |
| 492 |
</pre> |
| 493 |
</div><h4 id='method.push' class='method'><code>fn <a href='#method.push' class='fnname'>push</a>(&mut self, value: T)</code></h4> |
| 494 |
<div class='docblock'><p>Appends an element to the back of a collection.</p> |
| 495 |
|
| 496 |
<h1 id="panics" class='section-header'><a |
| 497 |
href="#panics">Panics</a></h1> |
| 498 |
<p>Panics if the number of elements in the vector overflows a <code>usize</code>.</p> |
| 499 |
|
| 500 |
<h1 id="examples" class='section-header'><a |
| 501 |
href="#examples">Examples</a></h1><span class='rusttest'>fn main() { |
| 502 |
let mut vec = vec!(1, 2); |
| 503 |
vec.push(3); |
| 504 |
assert_eq!(vec, [1, 2, 3]); |
| 505 |
|
| 506 |
}</span><pre id='rust-example-rendered' class='rust '> |
| 507 |
<span class='kw'>let</span> <span class='kw-2'>mut</span> <span class='ident'>vec</span> <span class='op'>=</span> <span class='macro'>vec</span><span class='macro'>!</span>(<span class='number'>1</span>, <span class='number'>2</span>); |
| 508 |
<span class='ident'>vec</span>.<span class='ident'>push</span>(<span class='number'>3</span>); |
| 509 |
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>vec</span>, [<span class='number'>1</span>, <span class='number'>2</span>, <span class='number'>3</span>]); |
| 510 |
</pre> |
| 511 |
</div><h4 id='method.pop' class='method'><code>fn <a href='#method.pop' class='fnname'>pop</a>(&mut self) -> <a class='enum' href='../../core/option/enum.Option.html' title='core::option::Option'>Option</a><T></code></h4> |
| 512 |
<div class='docblock'><p>Removes the last element from a vector and returns it, or <code>None</code> if it is empty.</p> |
| 513 |
|
| 514 |
<h1 id="examples" class='section-header'><a |
| 515 |
href="#examples">Examples</a></h1><span class='rusttest'>fn main() { |
| 516 |
let mut vec = vec![1, 2, 3]; |
| 517 |
assert_eq!(vec.pop(), Some(3)); |
| 518 |
assert_eq!(vec, [1, 2]); |
| 519 |
|
| 520 |
}</span><pre id='rust-example-rendered' class='rust '> |
| 521 |
<span class='kw'>let</span> <span class='kw-2'>mut</span> <span class='ident'>vec</span> <span class='op'>=</span> <span class='macro'>vec</span><span class='macro'>!</span>[<span class='number'>1</span>, <span class='number'>2</span>, <span class='number'>3</span>]; |
| 522 |
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>vec</span>.<span class='ident'>pop</span>(), <span class='prelude-val'>Some</span>(<span class='number'>3</span>)); |
| 523 |
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>vec</span>, [<span class='number'>1</span>, <span class='number'>2</span>]); |
| 524 |
</pre> |
| 525 |
</div><h4 id='method.append' class='method'><code>fn <a href='#method.append' class='fnname'>append</a>(&mut self, other: &mut Self)</code></h4> |
| 526 |
<div class='stability'><em class='stab unstable'>Unstable<p>: new API, waiting for dust to settle</p> |
| 527 |
</em></div><div class='docblock'><p>Moves all the elements of <code>other</code> into <code>Self</code>, leaving <code>other</code> empty.</p> |
| 528 |
|
| 529 |
<h1 id="panics" class='section-header'><a |
| 530 |
href="#panics">Panics</a></h1> |
| 531 |
<p>Panics if the number of elements in the vector overflows a <code>usize</code>.</p> |
| 532 |
|
| 533 |
<h1 id="examples" class='section-header'><a |
| 534 |
href="#examples">Examples</a></h1><span class='rusttest'>#![feature(collections)] |
| 535 |
extern crate collections; |
| 536 |
fn main() { |
| 537 |
let mut vec = vec![1, 2, 3]; |
| 538 |
let mut vec2 = vec![4, 5, 6]; |
| 539 |
vec.append(&mut vec2); |
| 540 |
assert_eq!(vec, [1, 2, 3, 4, 5, 6]); |
| 541 |
assert_eq!(vec2, []); |
| 542 |
|
| 543 |
}</span><pre id='rust-example-rendered' class='rust '> |
| 544 |
<span class='kw'>let</span> <span class='kw-2'>mut</span> <span class='ident'>vec</span> <span class='op'>=</span> <span class='macro'>vec</span><span class='macro'>!</span>[<span class='number'>1</span>, <span class='number'>2</span>, <span class='number'>3</span>]; |
| 545 |
<span class='kw'>let</span> <span class='kw-2'>mut</span> <span class='ident'>vec2</span> <span class='op'>=</span> <span class='macro'>vec</span><span class='macro'>!</span>[<span class='number'>4</span>, <span class='number'>5</span>, <span class='number'>6</span>]; |
| 546 |
<span class='ident'>vec</span>.<span class='ident'>append</span>(<span class='kw-2'>&</span><span class='kw-2'>mut</span> <span class='ident'>vec2</span>); |
| 547 |
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>vec</span>, [<span class='number'>1</span>, <span class='number'>2</span>, <span class='number'>3</span>, <span class='number'>4</span>, <span class='number'>5</span>, <span class='number'>6</span>]); |
| 548 |
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>vec2</span>, []); |
| 549 |
</pre> |
| 550 |
</div><h4 id='method.drain' class='method'><code>fn <a href='#method.drain' class='fnname'>drain</a><R>(&mut self, range: R) -> <a class='struct' href='../../collections/vec/struct.Drain.html' title='collections::vec::Drain'>Drain</a><T> <span class='where'>where R: <a class='trait' href='../../collections/range/trait.RangeArgument.html' title='collections::range::RangeArgument'>RangeArgument</a><<a href='../../core/primitive.usize.html'>usize</a>></span></code></h4> |
| 551 |
<div class='stability'><em class='stab unstable'>Unstable<p>: recently added, matches RFC</p> |
| 552 |
</em></div><div class='docblock'><p>Create a draining iterator that removes the specified range in the vector |
| 553 |
and yields the removed items from start to end. The element range is |
| 554 |
removed even if the iterator is not consumed until the end.</p> |
| 555 |
|
| 556 |
<p>Note: It is unspecified how many elements are removed from the vector, |
| 557 |
if the <code>Drain</code> value is leaked.</p> |
| 558 |
|
| 559 |
<h1 id="panics" class='section-header'><a |
| 560 |
href="#panics">Panics</a></h1> |
| 561 |
<p>Panics if the starting point is greater than the end point or if |
| 562 |
the end point is greater than the length of the vector.</p> |
| 563 |
|
| 564 |
<h1 id="examples" class='section-header'><a |
| 565 |
href="#examples">Examples</a></h1><span class='rusttest'>#![feature(collections_drain, collections_range)] |
| 566 |
|
| 567 |
extern crate collections; |
| 568 |
fn main() { |
| 569 |
// Draining using `..` clears the whole vector. |
| 570 |
let mut v = vec![1, 2, 3]; |
| 571 |
let u: Vec<_> = v.drain(..).collect(); |
| 572 |
assert_eq!(v, &[]); |
| 573 |
assert_eq!(u, &[1, 2, 3]); |
| 574 |
|
| 575 |
}</span><pre id='rust-example-rendered' class='rust '> |
| 576 |
|
| 577 |
<span class='comment'>// Draining using `..` clears the whole vector.</span> |
| 578 |
<span class='kw'>let</span> <span class='kw-2'>mut</span> <span class='ident'>v</span> <span class='op'>=</span> <span class='macro'>vec</span><span class='macro'>!</span>[<span class='number'>1</span>, <span class='number'>2</span>, <span class='number'>3</span>]; |
| 579 |
<span class='kw'>let</span> <span class='ident'>u</span>: <span class='ident'>Vec</span><span class='op'><</span>_<span class='op'>></span> <span class='op'>=</span> <span class='ident'>v</span>.<span class='ident'>drain</span>(..).<span class='ident'>collect</span>(); |
| 580 |
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>v</span>, <span class='kw-2'>&</span>[]); |
| 581 |
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>u</span>, <span class='kw-2'>&</span>[<span class='number'>1</span>, <span class='number'>2</span>, <span class='number'>3</span>]); |
| 582 |
</pre> |
| 583 |
</div><h4 id='method.clear' class='method'><code>fn <a href='#method.clear' class='fnname'>clear</a>(&mut self)</code></h4> |
| 584 |
<div class='docblock'><p>Clears the vector, removing all values.</p> |
| 585 |
|
| 586 |
<h1 id="examples" class='section-header'><a |
| 587 |
href="#examples">Examples</a></h1><span class='rusttest'>fn main() { |
| 588 |
let mut v = vec![1, 2, 3]; |
| 589 |
|
| 590 |
v.clear(); |
| 591 |
|
| 592 |
assert!(v.is_empty()); |
| 593 |
|
| 594 |
}</span><pre id='rust-example-rendered' class='rust '> |
| 595 |
<span class='kw'>let</span> <span class='kw-2'>mut</span> <span class='ident'>v</span> <span class='op'>=</span> <span class='macro'>vec</span><span class='macro'>!</span>[<span class='number'>1</span>, <span class='number'>2</span>, <span class='number'>3</span>]; |
| 596 |
|
| 597 |
<span class='ident'>v</span>.<span class='ident'>clear</span>(); |
| 598 |
|
| 599 |
<span class='macro'>assert</span><span class='macro'>!</span>(<span class='ident'>v</span>.<span class='ident'>is_empty</span>()); |
| 600 |
</pre> |
| 601 |
</div><h4 id='method.len' class='method'><code>fn <a href='#method.len' class='fnname'>len</a>(&self) -> <a href='../../core/primitive.usize.html'>usize</a></code></h4> |
| 602 |
<div class='docblock'><p>Returns the number of elements in the vector.</p> |
| 603 |
|
| 604 |
<h1 id="examples" class='section-header'><a |
| 605 |
href="#examples">Examples</a></h1><span class='rusttest'>fn main() { |
| 606 |
let a = vec![1, 2, 3]; |
| 607 |
assert_eq!(a.len(), 3); |
| 608 |
|
| 609 |
}</span><pre id='rust-example-rendered' class='rust '> |
| 610 |
<span class='kw'>let</span> <span class='ident'>a</span> <span class='op'>=</span> <span class='macro'>vec</span><span class='macro'>!</span>[<span class='number'>1</span>, <span class='number'>2</span>, <span class='number'>3</span>]; |
| 611 |
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>a</span>.<span class='ident'>len</span>(), <span class='number'>3</span>); |
| 612 |
</pre> |
| 613 |
</div><h4 id='method.is_empty' class='method'><code>fn <a href='#method.is_empty' class='fnname'>is_empty</a>(&self) -> <a href='../../core/primitive.bool.html'>bool</a></code></h4> |
| 614 |
<div class='docblock'><p>Returns <code>true</code> if the vector contains no elements.</p> |
| 615 |
|
| 616 |
<h1 id="examples" class='section-header'><a |
| 617 |
href="#examples">Examples</a></h1><span class='rusttest'>fn main() { |
| 618 |
let mut v = Vec::new(); |
| 619 |
assert!(v.is_empty()); |
| 620 |
|
| 621 |
v.push(1); |
| 622 |
assert!(!v.is_empty()); |
| 623 |
|
| 624 |
}</span><pre id='rust-example-rendered' class='rust '> |
| 625 |
<span class='kw'>let</span> <span class='kw-2'>mut</span> <span class='ident'>v</span> <span class='op'>=</span> <span class='ident'>Vec</span>::<span class='ident'>new</span>(); |
| 626 |
<span class='macro'>assert</span><span class='macro'>!</span>(<span class='ident'>v</span>.<span class='ident'>is_empty</span>()); |
| 627 |
|
| 628 |
<span class='ident'>v</span>.<span class='ident'>push</span>(<span class='number'>1</span>); |
| 629 |
<span class='macro'>assert</span><span class='macro'>!</span>(<span class='op'>!</span><span class='ident'>v</span>.<span class='ident'>is_empty</span>()); |
| 630 |
</pre> |
| 631 |
</div><h4 id='method.map_in_place' class='method'><code>fn <a href='#method.map_in_place' class='fnname'>map_in_place</a><U, F>(self, f: F) -> <a class='struct' href='../../collections/vec/struct.Vec.html' title='collections::vec::Vec'>Vec</a><U> <span class='where'>where F: <a class='trait' href='../../core/ops/trait.FnMut.html' title='core::ops::FnMut'>FnMut</a>(T) -> U</span></code></h4> |
| 632 |
<div class='stability'><em class='stab unstable'>Unstable<p>: API may change to provide stronger guarantees</p> |
| 633 |
</em></div><div class='docblock'><p>Converts a <code>Vec<T></code> to a <code>Vec<U></code> where <code>T</code> and <code>U</code> have the same |
| 634 |
size and in case they are not zero-sized the same minimal alignment.</p> |
| 635 |
|
| 636 |
<h1 id="panics" class='section-header'><a |
| 637 |
href="#panics">Panics</a></h1> |
| 638 |
<p>Panics if <code>T</code> and <code>U</code> have differing sizes or are not zero-sized and |
| 639 |
have differing minimal alignments.</p> |
| 640 |
|
| 641 |
<h1 id="examples" class='section-header'><a |
| 642 |
href="#examples">Examples</a></h1><span class='rusttest'>#![feature(collections, core)] |
| 643 |
extern crate collections; |
| 644 |
fn main() { |
| 645 |
let v = vec![0, 1, 2]; |
| 646 |
let w = v.map_in_place(|i| i + 3); |
| 647 |
assert_eq!(&w[..], &[3, 4, 5]); |
| 648 |
|
| 649 |
#[derive(PartialEq, Debug)] |
| 650 |
struct Newtype(u8); |
| 651 |
let bytes = vec![0x11, 0x22]; |
| 652 |
let newtyped_bytes = bytes.map_in_place(|x| Newtype(x)); |
| 653 |
assert_eq!(&newtyped_bytes[..], &[Newtype(0x11), Newtype(0x22)]); |
| 654 |
|
| 655 |
}</span><pre id='rust-example-rendered' class='rust '> |
| 656 |
<span class='kw'>let</span> <span class='ident'>v</span> <span class='op'>=</span> <span class='macro'>vec</span><span class='macro'>!</span>[<span class='number'>0</span>, <span class='number'>1</span>, <span class='number'>2</span>]; |
| 657 |
<span class='kw'>let</span> <span class='ident'>w</span> <span class='op'>=</span> <span class='ident'>v</span>.<span class='ident'>map_in_place</span>(<span class='op'>|</span><span class='ident'>i</span><span class='op'>|</span> <span class='ident'>i</span> <span class='op'>+</span> <span class='number'>3</span>); |
| 658 |
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='kw-2'>&</span><span class='ident'>w</span>[..], <span class='kw-2'>&</span>[<span class='number'>3</span>, <span class='number'>4</span>, <span class='number'>5</span>]); |
| 659 |
|
| 660 |
<span class='attribute'>#[<span class='ident'>derive</span>(<span class='ident'>PartialEq</span>, <span class='ident'>Debug</span>)]</span> |
| 661 |
<span class='kw'>struct</span> <span class='ident'>Newtype</span>(<span class='ident'>u8</span>); |
| 662 |
<span class='kw'>let</span> <span class='ident'>bytes</span> <span class='op'>=</span> <span class='macro'>vec</span><span class='macro'>!</span>[<span class='number'>0x11</span>, <span class='number'>0x22</span>]; |
| 663 |
<span class='kw'>let</span> <span class='ident'>newtyped_bytes</span> <span class='op'>=</span> <span class='ident'>bytes</span>.<span class='ident'>map_in_place</span>(<span class='op'>|</span><span class='ident'>x</span><span class='op'>|</span> <span class='ident'>Newtype</span>(<span class='ident'>x</span>)); |
| 664 |
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='kw-2'>&</span><span class='ident'>newtyped_bytes</span>[..], <span class='kw-2'>&</span>[<span class='ident'>Newtype</span>(<span class='number'>0x11</span>), <span class='ident'>Newtype</span>(<span class='number'>0x22</span>)]); |
| 665 |
</pre> |
| 666 |
</div><h4 id='method.split_off' class='method'><code>fn <a href='#method.split_off' class='fnname'>split_off</a>(&mut self, at: <a href='../../core/primitive.usize.html'>usize</a>) -> Self</code></h4> |
| 667 |
<div class='stability'><em class='stab unstable'>Unstable<p>: new API, waiting for dust to settle</p> |
| 668 |
</em></div><div class='docblock'><p>Splits the collection into two at the given index.</p> |
| 669 |
|
| 670 |
<p>Returns a newly allocated <code>Self</code>. <code>self</code> contains elements <code>[0, at)</code>, |
| 671 |
and the returned <code>Self</code> contains elements <code>[at, len)</code>.</p> |
| 672 |
|
| 673 |
<p>Note that the capacity of <code>self</code> does not change.</p> |
| 674 |
|
| 675 |
<h1 id="panics" class='section-header'><a |
| 676 |
href="#panics">Panics</a></h1> |
| 677 |
<p>Panics if <code>at > len</code>.</p> |
| 678 |
|
| 679 |
<h1 id="examples" class='section-header'><a |
| 680 |
href="#examples">Examples</a></h1><span class='rusttest'>#![feature(collections)] |
| 681 |
extern crate collections; |
| 682 |
fn main() { |
| 683 |
let mut vec = vec![1,2,3]; |
| 684 |
let vec2 = vec.split_off(1); |
| 685 |
assert_eq!(vec, [1]); |
| 686 |
assert_eq!(vec2, [2, 3]); |
| 687 |
|
| 688 |
}</span><pre id='rust-example-rendered' class='rust '> |
| 689 |
<span class='kw'>let</span> <span class='kw-2'>mut</span> <span class='ident'>vec</span> <span class='op'>=</span> <span class='macro'>vec</span><span class='macro'>!</span>[<span class='number'>1</span>,<span class='number'>2</span>,<span class='number'>3</span>]; |
| 690 |
<span class='kw'>let</span> <span class='ident'>vec2</span> <span class='op'>=</span> <span class='ident'>vec</span>.<span class='ident'>split_off</span>(<span class='number'>1</span>); |
| 691 |
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>vec</span>, [<span class='number'>1</span>]); |
| 692 |
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>vec2</span>, [<span class='number'>2</span>, <span class='number'>3</span>]); |
| 693 |
</pre> |
| 694 |
</div></div><h3 class='impl'><code>impl<T: <a class='trait' href='../../core/clone/trait.Clone.html' title='core::clone::Clone'>Clone</a>> <a class='struct' href='../../collections/vec/struct.Vec.html' title='collections::vec::Vec'>Vec</a><T></code></h3><div class='impl-items'><h4 id='method.resize' class='method'><code>fn <a href='#method.resize' class='fnname'>resize</a>(&mut self, new_len: <a href='../../core/primitive.usize.html'>usize</a>, value: T)</code></h4> |
| 695 |
<div class='stability'><em class='stab unstable'>Unstable<p>: matches collection reform specification; waiting for dust to settle</p> |
| 696 |
</em></div><div class='docblock'><p>Resizes the <code>Vec</code> in-place so that <code>len()</code> is equal to <code>new_len</code>.</p> |
| 697 |
|
| 698 |
<p>Calls either <code>extend()</code> or <code>truncate()</code> depending on whether <code>new_len</code> |
| 699 |
is larger than the current value of <code>len()</code> or not.</p> |
| 700 |
|
| 701 |
<h1 id="examples" class='section-header'><a |
| 702 |
href="#examples">Examples</a></h1><span class='rusttest'>#![feature(collections)] |
| 703 |
extern crate collections; |
| 704 |
fn main() { |
| 705 |
let mut vec = vec!["hello"]; |
| 706 |
vec.resize(3, "world"); |
| 707 |
assert_eq!(vec, ["hello", "world", "world"]); |
| 708 |
|
| 709 |
let mut vec = vec![1, 2, 3, 4]; |
| 710 |
vec.resize(2, 0); |
| 711 |
assert_eq!(vec, [1, 2]); |
| 712 |
|
| 713 |
}</span><pre id='rust-example-rendered' class='rust '> |
| 714 |
<span class='kw'>let</span> <span class='kw-2'>mut</span> <span class='ident'>vec</span> <span class='op'>=</span> <span class='macro'>vec</span><span class='macro'>!</span>[<span class='string'>"hello"</span>]; |
| 715 |
<span class='ident'>vec</span>.<span class='ident'>resize</span>(<span class='number'>3</span>, <span class='string'>"world"</span>); |
| 716 |
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>vec</span>, [<span class='string'>"hello"</span>, <span class='string'>"world"</span>, <span class='string'>"world"</span>]); |
| 717 |
|
| 718 |
<span class='kw'>let</span> <span class='kw-2'>mut</span> <span class='ident'>vec</span> <span class='op'>=</span> <span class='macro'>vec</span><span class='macro'>!</span>[<span class='number'>1</span>, <span class='number'>2</span>, <span class='number'>3</span>, <span class='number'>4</span>]; |
| 719 |
<span class='ident'>vec</span>.<span class='ident'>resize</span>(<span class='number'>2</span>, <span class='number'>0</span>); |
| 720 |
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>vec</span>, [<span class='number'>1</span>, <span class='number'>2</span>]); |
| 721 |
</pre> |
| 722 |
</div><h4 id='method.push_all' class='method'><code>fn <a href='#method.push_all' class='fnname'>push_all</a>(&mut self, other: <a href='../primitive.slice.html'>&[T]</a>)</code></h4> |
| 723 |
<div class='stability'><em class='stab unstable'>Unstable<p>: likely to be replaced by a more optimized extend</p> |
| 724 |
</em></div><div class='docblock'><p>Appends all elements in a slice to the <code>Vec</code>.</p> |
| 725 |
|
| 726 |
<p>Iterates over the slice <code>other</code>, clones each element, and then appends |
| 727 |
it to this <code>Vec</code>. The <code>other</code> vector is traversed in-order.</p> |
| 728 |
|
| 729 |
<h1 id="examples" class='section-header'><a |
| 730 |
href="#examples">Examples</a></h1><span class='rusttest'>#![feature(collections)] |
| 731 |
extern crate collections; |
| 732 |
fn main() { |
| 733 |
let mut vec = vec![1]; |
| 734 |
vec.push_all(&[2, 3, 4]); |
| 735 |
assert_eq!(vec, [1, 2, 3, 4]); |
| 736 |
|
| 737 |
}</span><pre id='rust-example-rendered' class='rust '> |
| 738 |
<span class='kw'>let</span> <span class='kw-2'>mut</span> <span class='ident'>vec</span> <span class='op'>=</span> <span class='macro'>vec</span><span class='macro'>!</span>[<span class='number'>1</span>]; |
| 739 |
<span class='ident'>vec</span>.<span class='ident'>push_all</span>(<span class='kw-2'>&</span>[<span class='number'>2</span>, <span class='number'>3</span>, <span class='number'>4</span>]); |
| 740 |
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>vec</span>, [<span class='number'>1</span>, <span class='number'>2</span>, <span class='number'>3</span>, <span class='number'>4</span>]); |
| 741 |
</pre> |
| 742 |
</div></div><h3 class='impl'><code>impl<T: <a class='trait' href='../../core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a>> <a class='struct' href='../../collections/vec/struct.Vec.html' title='collections::vec::Vec'>Vec</a><T></code></h3><div class='impl-items'><h4 id='method.dedup' class='method'><code>fn <a href='#method.dedup' class='fnname'>dedup</a>(&mut self)</code></h4> |
| 743 |
<div class='docblock'><p>Removes consecutive repeated elements in the vector.</p> |
| 744 |
|
| 745 |
<p>If the vector is sorted, this removes all duplicates.</p> |
| 746 |
|
| 747 |
<h1 id="examples" class='section-header'><a |
| 748 |
href="#examples">Examples</a></h1><span class='rusttest'>fn main() { |
| 749 |
let mut vec = vec![1, 2, 2, 3, 2]; |
| 750 |
|
| 751 |
vec.dedup(); |
| 752 |
|
| 753 |
assert_eq!(vec, [1, 2, 3, 2]); |
| 754 |
|
| 755 |
}</span><pre id='rust-example-rendered' class='rust '> |
| 756 |
<span class='kw'>let</span> <span class='kw-2'>mut</span> <span class='ident'>vec</span> <span class='op'>=</span> <span class='macro'>vec</span><span class='macro'>!</span>[<span class='number'>1</span>, <span class='number'>2</span>, <span class='number'>2</span>, <span class='number'>3</span>, <span class='number'>2</span>]; |
| 757 |
|
| 758 |
<span class='ident'>vec</span>.<span class='ident'>dedup</span>(); |
| 759 |
|
| 760 |
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>vec</span>, [<span class='number'>1</span>, <span class='number'>2</span>, <span class='number'>3</span>, <span class='number'>2</span>]); |
| 761 |
</pre> |
| 762 |
</div></div><h2 id='deref-methods'>Methods from <a class='trait' href='../../core/ops/trait.Deref.html' title='core::ops::Deref'>Deref</a><Target=<a href='../primitive.slice.html'>[T]</a>></h2><div class='impl-items'><h4 id='method.sort_by' class='method'><code>fn <a href='#method.sort_by' class='fnname'>sort_by</a><F>(&mut self, compare: F) <span class='where'>where F: <a class='trait' href='../../core/ops/trait.FnMut.html' title='core::ops::FnMut'>FnMut</a>(&T, &T) -> <a class='enum' href='../../core/cmp/enum.Ordering.html' title='core::cmp::Ordering'>Ordering</a></span></code></h4> |
| 763 |
<div class='docblock'><p>Sorts the slice, in place, using <code>compare</code> to compare |
| 764 |
elements.</p> |
| 765 |
|
| 766 |
<p>This sort is <code>O(n log n)</code> worst-case and stable, but allocates |
| 767 |
approximately <code>2 * n</code>, where <code>n</code> is the length of <code>self</code>.</p> |
| 768 |
|
| 769 |
<h1 id="examples" class='section-header'><a |
| 770 |
href="#examples">Examples</a></h1><span class='rusttest'>fn main() { |
| 771 |
let mut v = [5, 4, 1, 3, 2]; |
| 772 |
v.sort_by(|a, b| a.cmp(b)); |
| 773 |
assert!(v == [1, 2, 3, 4, 5]); |
| 774 |
|
| 775 |
// reverse sorting |
| 776 |
v.sort_by(|a, b| b.cmp(a)); |
| 777 |
assert!(v == [5, 4, 3, 2, 1]); |
| 778 |
|
| 779 |
}</span><pre id='rust-example-rendered' class='rust '> |
| 780 |
<span class='kw'>let</span> <span class='kw-2'>mut</span> <span class='ident'>v</span> <span class='op'>=</span> [<span class='number'>5</span>, <span class='number'>4</span>, <span class='number'>1</span>, <span class='number'>3</span>, <span class='number'>2</span>]; |
| 781 |
<span class='ident'>v</span>.<span class='ident'>sort_by</span>(<span class='op'>|</span><span class='ident'>a</span>, <span class='ident'>b</span><span class='op'>|</span> <span class='ident'>a</span>.<span class='ident'>cmp</span>(<span class='ident'>b</span>)); |
| 782 |
<span class='macro'>assert</span><span class='macro'>!</span>(<span class='ident'>v</span> <span class='op'>==</span> [<span class='number'>1</span>, <span class='number'>2</span>, <span class='number'>3</span>, <span class='number'>4</span>, <span class='number'>5</span>]); |
| 783 |
|
| 784 |
<span class='comment'>// reverse sorting</span> |
| 785 |
<span class='ident'>v</span>.<span class='ident'>sort_by</span>(<span class='op'>|</span><span class='ident'>a</span>, <span class='ident'>b</span><span class='op'>|</span> <span class='ident'>b</span>.<span class='ident'>cmp</span>(<span class='ident'>a</span>)); |
| 786 |
<span class='macro'>assert</span><span class='macro'>!</span>(<span class='ident'>v</span> <span class='op'>==</span> [<span class='number'>5</span>, <span class='number'>4</span>, <span class='number'>3</span>, <span class='number'>2</span>, <span class='number'>1</span>]); |
| 787 |
</pre> |
| 788 |
</div><h4 id='method.move_from' class='method'><code>fn <a href='#method.move_from' class='fnname'>move_from</a>(&mut self, src: <a class='struct' href='../../collections/vec/struct.Vec.html' title='collections::vec::Vec'>Vec</a><T>, start: <a href='../../core/primitive.usize.html'>usize</a>, end: <a href='../../core/primitive.usize.html'>usize</a>) -> <a href='../../core/primitive.usize.html'>usize</a></code></h4> |
| 789 |
<div class='stability'><em class='stab unstable'>Unstable<p>: uncertain about this API approach</p> |
| 790 |
</em></div><div class='docblock'><p>Consumes <code>src</code> and moves as many elements as it can into <code>self</code> |
| 791 |
from the range [start,end).</p> |
| 792 |
|
| 793 |
<p>Returns the number of elements copied (the shorter of <code>self.len()</code> |
| 794 |
and <code>end - start</code>).</p> |
| 795 |
|
| 796 |
<h1 id="arguments" class='section-header'><a |
| 797 |
href="#arguments">Arguments</a></h1> |
| 798 |
<ul> |
| 799 |
<li>src - A mutable vector of <code>T</code></li> |
| 800 |
<li>start - The index into <code>src</code> to start copying from</li> |
| 801 |
<li>end - The index into <code>src</code> to stop copying from</li> |
| 802 |
</ul> |
| 803 |
|
| 804 |
<h1 id="examples" class='section-header'><a |
| 805 |
href="#examples">Examples</a></h1><span class='rusttest'>#![feature(collections)] |
| 806 |
extern crate collections; |
| 807 |
fn main() { |
| 808 |
let mut a = [1, 2, 3, 4, 5]; |
| 809 |
let b = vec![6, 7, 8]; |
| 810 |
let num_moved = a.move_from(b, 0, 3); |
| 811 |
assert_eq!(num_moved, 3); |
| 812 |
assert!(a == [6, 7, 8, 4, 5]); |
| 813 |
|
| 814 |
}</span><pre id='rust-example-rendered' class='rust '> |
| 815 |
<span class='kw'>let</span> <span class='kw-2'>mut</span> <span class='ident'>a</span> <span class='op'>=</span> [<span class='number'>1</span>, <span class='number'>2</span>, <span class='number'>3</span>, <span class='number'>4</span>, <span class='number'>5</span>]; |
| 816 |
<span class='kw'>let</span> <span class='ident'>b</span> <span class='op'>=</span> <span class='macro'>vec</span><span class='macro'>!</span>[<span class='number'>6</span>, <span class='number'>7</span>, <span class='number'>8</span>]; |
| 817 |
<span class='kw'>let</span> <span class='ident'>num_moved</span> <span class='op'>=</span> <span class='ident'>a</span>.<span class='ident'>move_from</span>(<span class='ident'>b</span>, <span class='number'>0</span>, <span class='number'>3</span>); |
| 818 |
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>num_moved</span>, <span class='number'>3</span>); |
| 819 |
<span class='macro'>assert</span><span class='macro'>!</span>(<span class='ident'>a</span> <span class='op'>==</span> [<span class='number'>6</span>, <span class='number'>7</span>, <span class='number'>8</span>, <span class='number'>4</span>, <span class='number'>5</span>]); |
| 820 |
</pre> |
| 821 |
</div><h4 id='method.split_at' class='method'><code>fn <a href='#method.split_at' class='fnname'>split_at</a>(&self, mid: <a href='../../core/primitive.usize.html'>usize</a>) -> <a href='../../core/primitive.tuple.html'>(<a href='../primitive.slice.html'>&[T]</a>, <a href='../primitive.slice.html'>&[T]</a>)</a></code></h4> |
| 822 |
<div class='docblock'><p>Divides one slice into two at an index.</p> |
| 823 |
|
| 824 |
<p>The first will contain all indices from <code>[0, mid)</code> (excluding |
| 825 |
the index <code>mid</code> itself) and the second will contain all |
| 826 |
indices from <code>[mid, len)</code> (excluding the index <code>len</code> itself).</p> |
| 827 |
|
| 828 |
<p>Panics if <code>mid > len</code>.</p> |
| 829 |
|
| 830 |
<h1 id="examples" class='section-header'><a |
| 831 |
href="#examples">Examples</a></h1><span class='rusttest'>fn main() { |
| 832 |
let v = [10, 40, 30, 20, 50]; |
| 833 |
let (v1, v2) = v.split_at(2); |
| 834 |
assert_eq!([10, 40], v1); |
| 835 |
assert_eq!([30, 20, 50], v2); |
| 836 |
|
| 837 |
}</span><pre id='rust-example-rendered' class='rust '> |
| 838 |
<span class='kw'>let</span> <span class='ident'>v</span> <span class='op'>=</span> [<span class='number'>10</span>, <span class='number'>40</span>, <span class='number'>30</span>, <span class='number'>20</span>, <span class='number'>50</span>]; |
| 839 |
<span class='kw'>let</span> (<span class='ident'>v1</span>, <span class='ident'>v2</span>) <span class='op'>=</span> <span class='ident'>v</span>.<span class='ident'>split_at</span>(<span class='number'>2</span>); |
| 840 |
<span class='macro'>assert_eq</span><span class='macro'>!</span>([<span class='number'>10</span>, <span class='number'>40</span>], <span class='ident'>v1</span>); |
| 841 |
<span class='macro'>assert_eq</span><span class='macro'>!</span>([<span class='number'>30</span>, <span class='number'>20</span>, <span class='number'>50</span>], <span class='ident'>v2</span>); |
| 842 |
</pre> |
| 843 |
</div><h4 id='method.iter' class='method'><code>fn <a href='#method.iter' class='fnname'>iter</a>(&self) -> <a class='struct' href='../../collections/slice/struct.Iter.html' title='collections::slice::Iter'>Iter</a><T></code></h4> |
| 844 |
<div class='docblock'><p>Returns an iterator over the slice.</p> |
| 845 |
</div><h4 id='method.split' class='method'><code>fn <a href='#method.split' class='fnname'>split</a><F>(&self, pred: F) -> <a class='struct' href='../../collections/slice/struct.Split.html' title='collections::slice::Split'>Split</a><T, F> <span class='where'>where F: <a class='trait' href='../../core/ops/trait.FnMut.html' title='core::ops::FnMut'>FnMut</a>(&T) -> <a href='../../core/primitive.bool.html'>bool</a></span></code></h4> |
| 846 |
<div class='docblock'><p>Returns an iterator over subslices separated by elements that match |
| 847 |
<code>pred</code>. The matched element is not contained in the subslices.</p> |
| 848 |
|
| 849 |
<h1 id="examples" class='section-header'><a |
| 850 |
href="#examples">Examples</a></h1> |
| 851 |
<p>Print the slice split by numbers divisible by 3 (i.e. <code>[10, 40]</code>, |
| 852 |
<code>[20]</code>, <code>[50]</code>):</p> |
| 853 |
<span class='rusttest'>fn main() { |
| 854 |
let v = [10, 40, 30, 20, 60, 50]; |
| 855 |
for group in v.split(|num| *num % 3 == 0) { |
| 856 |
println!("{:?}", group); |
| 857 |
} |
| 858 |
|
| 859 |
}</span><pre id='rust-example-rendered' class='rust '> |
| 860 |
<span class='kw'>let</span> <span class='ident'>v</span> <span class='op'>=</span> [<span class='number'>10</span>, <span class='number'>40</span>, <span class='number'>30</span>, <span class='number'>20</span>, <span class='number'>60</span>, <span class='number'>50</span>]; |
| 861 |
<span class='kw'>for</span> <span class='ident'>group</span> <span class='kw'>in</span> <span class='ident'>v</span>.<span class='ident'>split</span>(<span class='op'>|</span><span class='ident'>num</span><span class='op'>|</span> <span class='op'>*</span><span class='ident'>num</span> <span class='op'>%</span> <span class='number'>3</span> <span class='op'>==</span> <span class='number'>0</span>) { |
| 862 |
<span class='macro'>println</span><span class='macro'>!</span>(<span class='string'>"{:?}"</span>, <span class='ident'>group</span>); |
| 863 |
} |
| 864 |
</pre> |
| 865 |
</div><h4 id='method.splitn' class='method'><code>fn <a href='#method.splitn' class='fnname'>splitn</a><F>(&self, n: <a href='../../core/primitive.usize.html'>usize</a>, pred: F) -> <a class='struct' href='../../collections/slice/struct.SplitN.html' title='collections::slice::SplitN'>SplitN</a><T, F> <span class='where'>where F: <a class='trait' href='../../core/ops/trait.FnMut.html' title='core::ops::FnMut'>FnMut</a>(&T) -> <a href='../../core/primitive.bool.html'>bool</a></span></code></h4> |
| 866 |
<div class='docblock'><p>Returns an iterator over subslices separated by elements that match |
| 867 |
<code>pred</code>, limited to returning at most <code>n</code> items. The matched element is |
| 868 |
not contained in the subslices.</p> |
| 869 |
|
| 870 |
<p>The last element returned, if any, will contain the remainder of the |
| 871 |
slice.</p> |
| 872 |
|
| 873 |
<h1 id="examples" class='section-header'><a |
| 874 |
href="#examples">Examples</a></h1> |
| 875 |
<p>Print the slice split once by numbers divisible by 3 (i.e. <code>[10, 40]</code>, |
| 876 |
<code>[20, 60, 50]</code>):</p> |
| 877 |
<span class='rusttest'>fn main() { |
| 878 |
let v = [10, 40, 30, 20, 60, 50]; |
| 879 |
for group in v.splitn(2, |num| *num % 3 == 0) { |
| 880 |
println!("{:?}", group); |
| 881 |
} |
| 882 |
|
| 883 |
}</span><pre id='rust-example-rendered' class='rust '> |
| 884 |
<span class='kw'>let</span> <span class='ident'>v</span> <span class='op'>=</span> [<span class='number'>10</span>, <span class='number'>40</span>, <span class='number'>30</span>, <span class='number'>20</span>, <span class='number'>60</span>, <span class='number'>50</span>]; |
| 885 |
<span class='kw'>for</span> <span class='ident'>group</span> <span class='kw'>in</span> <span class='ident'>v</span>.<span class='ident'>splitn</span>(<span class='number'>2</span>, <span class='op'>|</span><span class='ident'>num</span><span class='op'>|</span> <span class='op'>*</span><span class='ident'>num</span> <span class='op'>%</span> <span class='number'>3</span> <span class='op'>==</span> <span class='number'>0</span>) { |
| 886 |
<span class='macro'>println</span><span class='macro'>!</span>(<span class='string'>"{:?}"</span>, <span class='ident'>group</span>); |
| 887 |
} |
| 888 |
</pre> |
| 889 |
</div><h4 id='method.rsplitn' class='method'><code>fn <a href='#method.rsplitn' class='fnname'>rsplitn</a><F>(&self, n: <a href='../../core/primitive.usize.html'>usize</a>, pred: F) -> <a class='struct' href='../../collections/slice/struct.RSplitN.html' title='collections::slice::RSplitN'>RSplitN</a><T, F> <span class='where'>where F: <a class='trait' href='../../core/ops/trait.FnMut.html' title='core::ops::FnMut'>FnMut</a>(&T) -> <a href='../../core/primitive.bool.html'>bool</a></span></code></h4> |
| 890 |
<div class='docblock'><p>Returns an iterator over subslices separated by elements that match |
| 891 |
<code>pred</code> limited to returning at most <code>n</code> items. This starts at the end of |
| 892 |
the slice and works backwards. The matched element is not contained in |
| 893 |
the subslices.</p> |
| 894 |
|
| 895 |
<p>The last element returned, if any, will contain the remainder of the |
| 896 |
slice.</p> |
| 897 |
|
| 898 |
<h1 id="examples" class='section-header'><a |
| 899 |
href="#examples">Examples</a></h1> |
| 900 |
<p>Print the slice split once, starting from the end, by numbers divisible |
| 901 |
by 3 (i.e. <code>[50]</code>, <code>[10, 40, 30, 20]</code>):</p> |
| 902 |
<span class='rusttest'>fn main() { |
| 903 |
let v = [10, 40, 30, 20, 60, 50]; |
| 904 |
for group in v.rsplitn(2, |num| *num % 3 == 0) { |
| 905 |
println!("{:?}", group); |
| 906 |
} |
| 907 |
|
| 908 |
}</span><pre id='rust-example-rendered' class='rust '> |
| 909 |
<span class='kw'>let</span> <span class='ident'>v</span> <span class='op'>=</span> [<span class='number'>10</span>, <span class='number'>40</span>, <span class='number'>30</span>, <span class='number'>20</span>, <span class='number'>60</span>, <span class='number'>50</span>]; |
| 910 |
<span class='kw'>for</span> <span class='ident'>group</span> <span class='kw'>in</span> <span class='ident'>v</span>.<span class='ident'>rsplitn</span>(<span class='number'>2</span>, <span class='op'>|</span><span class='ident'>num</span><span class='op'>|</span> <span class='op'>*</span><span class='ident'>num</span> <span class='op'>%</span> <span class='number'>3</span> <span class='op'>==</span> <span class='number'>0</span>) { |
| 911 |
<span class='macro'>println</span><span class='macro'>!</span>(<span class='string'>"{:?}"</span>, <span class='ident'>group</span>); |
| 912 |
} |
| 913 |
</pre> |
| 914 |
</div><h4 id='method.windows' class='method'><code>fn <a href='#method.windows' class='fnname'>windows</a>(&self, size: <a href='../../core/primitive.usize.html'>usize</a>) -> <a class='struct' href='../../collections/slice/struct.Windows.html' title='collections::slice::Windows'>Windows</a><T></code></h4> |
| 915 |
<div class='docblock'><p>Returns an iterator over all contiguous windows of length |
| 916 |
<code>size</code>. The windows overlap. If the slice is shorter than |
| 917 |
<code>size</code>, the iterator returns no values.</p> |
| 918 |
|
| 919 |
<h1 id="panics" class='section-header'><a |
| 920 |
href="#panics">Panics</a></h1> |
| 921 |
<p>Panics if <code>size</code> is 0.</p> |
| 922 |
|
| 923 |
<h1 id="example" class='section-header'><a |
| 924 |
href="#example">Example</a></h1> |
| 925 |
<p>Print the adjacent pairs of a slice (i.e. <code>[1,2]</code>, <code>[2,3]</code>, |
| 926 |
<code>[3,4]</code>):</p> |
| 927 |
<span class='rusttest'>fn main() { |
| 928 |
let v = &[1, 2, 3, 4]; |
| 929 |
for win in v.windows(2) { |
| 930 |
println!("{:?}", win); |
| 931 |
} |
| 932 |
|
| 933 |
}</span><pre id='rust-example-rendered' class='rust '> |
| 934 |
<span class='kw'>let</span> <span class='ident'>v</span> <span class='op'>=</span> <span class='kw-2'>&</span>[<span class='number'>1</span>, <span class='number'>2</span>, <span class='number'>3</span>, <span class='number'>4</span>]; |
| 935 |
<span class='kw'>for</span> <span class='ident'>win</span> <span class='kw'>in</span> <span class='ident'>v</span>.<span class='ident'>windows</span>(<span class='number'>2</span>) { |
| 936 |
<span class='macro'>println</span><span class='macro'>!</span>(<span class='string'>"{:?}"</span>, <span class='ident'>win</span>); |
| 937 |
} |
| 938 |
</pre> |
| 939 |
</div><h4 id='method.chunks' class='method'><code>fn <a href='#method.chunks' class='fnname'>chunks</a>(&self, size: <a href='../../core/primitive.usize.html'>usize</a>) -> <a class='struct' href='../../collections/slice/struct.Chunks.html' title='collections::slice::Chunks'>Chunks</a><T></code></h4> |
| 940 |
<div class='docblock'><p>Returns an iterator over <code>size</code> elements of the slice at a |
| 941 |
time. The chunks do not overlap. If <code>size</code> does not divide the |
| 942 |
length of the slice, then the last chunk will not have length |
| 943 |
<code>size</code>.</p> |
| 944 |
|
| 945 |
<h1 id="panics" class='section-header'><a |
| 946 |
href="#panics">Panics</a></h1> |
| 947 |
<p>Panics if <code>size</code> is 0.</p> |
| 948 |
|
| 949 |
<h1 id="example" class='section-header'><a |
| 950 |
href="#example">Example</a></h1> |
| 951 |
<p>Print the slice two elements at a time (i.e. <code>[1,2]</code>, |
| 952 |
<code>[3,4]</code>, <code>[5]</code>):</p> |
| 953 |
<span class='rusttest'>fn main() { |
| 954 |
let v = &[1, 2, 3, 4, 5]; |
| 955 |
for win in v.chunks(2) { |
| 956 |
println!("{:?}", win); |
| 957 |
} |
| 958 |
|
| 959 |
}</span><pre id='rust-example-rendered' class='rust '> |
| 960 |
<span class='kw'>let</span> <span class='ident'>v</span> <span class='op'>=</span> <span class='kw-2'>&</span>[<span class='number'>1</span>, <span class='number'>2</span>, <span class='number'>3</span>, <span class='number'>4</span>, <span class='number'>5</span>]; |
| 961 |
<span class='kw'>for</span> <span class='ident'>win</span> <span class='kw'>in</span> <span class='ident'>v</span>.<span class='ident'>chunks</span>(<span class='number'>2</span>) { |
| 962 |
<span class='macro'>println</span><span class='macro'>!</span>(<span class='string'>"{:?}"</span>, <span class='ident'>win</span>); |
| 963 |
} |
| 964 |
</pre> |
| 965 |
</div><h4 id='method.get' class='method'><code>fn <a href='#method.get' class='fnname'>get</a>(&self, index: <a href='../../core/primitive.usize.html'>usize</a>) -> <a class='enum' href='../../core/option/enum.Option.html' title='core::option::Option'>Option</a><&T></code></h4> |
| 966 |
<div class='docblock'><p>Returns the element of a slice at the given index, or <code>None</code> if the |
| 967 |
index is out of bounds.</p> |
| 968 |
|
| 969 |
<h1 id="examples" class='section-header'><a |
| 970 |
href="#examples">Examples</a></h1><span class='rusttest'>fn main() { |
| 971 |
let v = [10, 40, 30]; |
| 972 |
assert_eq!(Some(&40), v.get(1)); |
| 973 |
assert_eq!(None, v.get(3)); |
| 974 |
|
| 975 |
}</span><pre id='rust-example-rendered' class='rust '> |
| 976 |
<span class='kw'>let</span> <span class='ident'>v</span> <span class='op'>=</span> [<span class='number'>10</span>, <span class='number'>40</span>, <span class='number'>30</span>]; |
| 977 |
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='prelude-val'>Some</span>(<span class='kw-2'>&</span><span class='number'>40</span>), <span class='ident'>v</span>.<span class='ident'>get</span>(<span class='number'>1</span>)); |
| 978 |
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='prelude-val'>None</span>, <span class='ident'>v</span>.<span class='ident'>get</span>(<span class='number'>3</span>)); |
| 979 |
</pre> |
| 980 |
</div><h4 id='method.first' class='method'><code>fn <a href='#method.first' class='fnname'>first</a>(&self) -> <a class='enum' href='../../core/option/enum.Option.html' title='core::option::Option'>Option</a><&T></code></h4> |
| 981 |
<div class='docblock'><p>Returns the first element of a slice, or <code>None</code> if it is empty.</p> |
| 982 |
|
| 983 |
<h1 id="examples" class='section-header'><a |
| 984 |
href="#examples">Examples</a></h1><span class='rusttest'>fn main() { |
| 985 |
let v = [10, 40, 30]; |
| 986 |
assert_eq!(Some(&10), v.first()); |
| 987 |
|
| 988 |
let w: &[i32] = &[]; |
| 989 |
assert_eq!(None, w.first()); |
| 990 |
|
| 991 |
}</span><pre id='rust-example-rendered' class='rust '> |
| 992 |
<span class='kw'>let</span> <span class='ident'>v</span> <span class='op'>=</span> [<span class='number'>10</span>, <span class='number'>40</span>, <span class='number'>30</span>]; |
| 993 |
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='prelude-val'>Some</span>(<span class='kw-2'>&</span><span class='number'>10</span>), <span class='ident'>v</span>.<span class='ident'>first</span>()); |
| 994 |
|
| 995 |
<span class='kw'>let</span> <span class='ident'>w</span>: <span class='kw-2'>&</span>[<span class='ident'>i32</span>] <span class='op'>=</span> <span class='kw-2'>&</span>[]; |
| 996 |
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='prelude-val'>None</span>, <span class='ident'>w</span>.<span class='ident'>first</span>()); |
| 997 |
</pre> |
| 998 |
</div><h4 id='method.tail' class='method'><code>fn <a href='#method.tail' class='fnname'>tail</a>(&self) -> <a href='../primitive.slice.html'>&[T]</a></code></h4> |
| 999 |
<div class='stability'><em class='stab unstable'>Unstable<p>: likely to be renamed</p> |
| 1000 |
</em></div><div class='docblock'><p>Returns all but the first element of a slice.</p> |
| 1001 |
</div><h4 id='method.init' class='method'><code>fn <a href='#method.init' class='fnname'>init</a>(&self) -> <a href='../primitive.slice.html'>&[T]</a></code></h4> |
| 1002 |
<div class='stability'><em class='stab unstable'>Unstable<p>: likely to be renamed</p> |
| 1003 |
</em></div><div class='docblock'><p>Returns all but the last element of a slice.</p> |
| 1004 |
</div><h4 id='method.last' class='method'><code>fn <a href='#method.last' class='fnname'>last</a>(&self) -> <a class='enum' href='../../core/option/enum.Option.html' title='core::option::Option'>Option</a><&T></code></h4> |
| 1005 |
<div class='docblock'><p>Returns the last element of a slice, or <code>None</code> if it is empty.</p> |
| 1006 |
|
| 1007 |
<h1 id="examples" class='section-header'><a |
| 1008 |
href="#examples">Examples</a></h1><span class='rusttest'>fn main() { |
| 1009 |
let v = [10, 40, 30]; |
| 1010 |
assert_eq!(Some(&30), v.last()); |
| 1011 |
|
| 1012 |
let w: &[i32] = &[]; |
| 1013 |
assert_eq!(None, w.last()); |
| 1014 |
|
| 1015 |
}</span><pre id='rust-example-rendered' class='rust '> |
| 1016 |
<span class='kw'>let</span> <span class='ident'>v</span> <span class='op'>=</span> [<span class='number'>10</span>, <span class='number'>40</span>, <span class='number'>30</span>]; |
| 1017 |
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='prelude-val'>Some</span>(<span class='kw-2'>&</span><span class='number'>30</span>), <span class='ident'>v</span>.<span class='ident'>last</span>()); |
| 1018 |
|
| 1019 |
<span class='kw'>let</span> <span class='ident'>w</span>: <span class='kw-2'>&</span>[<span class='ident'>i32</span>] <span class='op'>=</span> <span class='kw-2'>&</span>[]; |
| 1020 |
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='prelude-val'>None</span>, <span class='ident'>w</span>.<span class='ident'>last</span>()); |
| 1021 |
</pre> |
| 1022 |
</div><h4 id='method.get_unchecked' class='method'><code>unsafe fn <a href='#method.get_unchecked' class='fnname'>get_unchecked</a>(&self, index: <a href='../../core/primitive.usize.html'>usize</a>) -> &T</code></h4> |
| 1023 |
<div class='docblock'><p>Returns a pointer to the element at the given index, without doing |
| 1024 |
bounds checking.</p> |
| 1025 |
</div><h4 id='method.as_ptr' class='method'><code>fn <a href='#method.as_ptr' class='fnname'>as_ptr</a>(&self) -> <a href='../../core/primitive.pointer.html'>*const T</a></code></h4> |
| 1026 |
<div class='docblock'><p>Returns an unsafe pointer to the slice's buffer</p> |
| 1027 |
|
| 1028 |
<p>The caller must ensure that the slice outlives the pointer this |
| 1029 |
function returns, or else it will end up pointing to garbage.</p> |
| 1030 |
|
| 1031 |
<p>Modifying the slice may cause its buffer to be reallocated, which |
| 1032 |
would also make any pointers to it invalid.</p> |
| 1033 |
</div><h4 id='method.binary_search_by' class='method'><code>fn <a href='#method.binary_search_by' class='fnname'>binary_search_by</a><F>(&self, f: F) -> <a class='enum' href='../../core/result/enum.Result.html' title='core::result::Result'>Result</a><<a href='../../core/primitive.usize.html'>usize</a>, <a href='../../core/primitive.usize.html'>usize</a>> <span class='where'>where F: <a class='trait' href='../../core/ops/trait.FnMut.html' title='core::ops::FnMut'>FnMut</a>(&T) -> <a class='enum' href='../../core/cmp/enum.Ordering.html' title='core::cmp::Ordering'>Ordering</a></span></code></h4> |
| 1034 |
<div class='docblock'><p>Binary search a sorted slice with a comparator function.</p> |
| 1035 |
|
| 1036 |
<p>The comparator function should implement an order consistent |
| 1037 |
with the sort order of the underlying slice, returning an |
| 1038 |
order code that indicates whether its argument is <code>Less</code>, |
| 1039 |
<code>Equal</code> or <code>Greater</code> the desired target.</p> |
| 1040 |
|
| 1041 |
<p>If a matching value is found then returns <code>Ok</code>, containing |
| 1042 |
the index for the matched element; if no match is found then |
| 1043 |
<code>Err</code> is returned, containing the index where a matching |
| 1044 |
element could be inserted while maintaining sorted order.</p> |
| 1045 |
|
| 1046 |
<h1 id="example" class='section-header'><a |
| 1047 |
href="#example">Example</a></h1> |
| 1048 |
<p>Looks up a series of four elements. The first is found, with a |
| 1049 |
uniquely determined position; the second and third are not |
| 1050 |
found; the fourth could match any position in <code>[1,4]</code>.</p> |
| 1051 |
<span class='rusttest'>#![feature(core)] |
| 1052 |
fn main() { |
| 1053 |
let s = [0, 1, 1, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55]; |
| 1054 |
|
| 1055 |
let seek = 13; |
| 1056 |
assert_eq!(s.binary_search_by(|probe| probe.cmp(&seek)), Ok(9)); |
| 1057 |
let seek = 4; |
| 1058 |
assert_eq!(s.binary_search_by(|probe| probe.cmp(&seek)), Err(7)); |
| 1059 |
let seek = 100; |
| 1060 |
assert_eq!(s.binary_search_by(|probe| probe.cmp(&seek)), Err(13)); |
| 1061 |
let seek = 1; |
| 1062 |
let r = s.binary_search_by(|probe| probe.cmp(&seek)); |
| 1063 |
assert!(match r { Ok(1...4) => true, _ => false, }); |
| 1064 |
|
| 1065 |
}</span><pre id='rust-example-rendered' class='rust '> |
| 1066 |
<span class='kw'>let</span> <span class='ident'>s</span> <span class='op'>=</span> [<span class='number'>0</span>, <span class='number'>1</span>, <span class='number'>1</span>, <span class='number'>1</span>, <span class='number'>1</span>, <span class='number'>2</span>, <span class='number'>3</span>, <span class='number'>5</span>, <span class='number'>8</span>, <span class='number'>13</span>, <span class='number'>21</span>, <span class='number'>34</span>, <span class='number'>55</span>]; |
| 1067 |
|
| 1068 |
<span class='kw'>let</span> <span class='ident'>seek</span> <span class='op'>=</span> <span class='number'>13</span>; |
| 1069 |
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>s</span>.<span class='ident'>binary_search_by</span>(<span class='op'>|</span><span class='ident'>probe</span><span class='op'>|</span> <span class='ident'>probe</span>.<span class='ident'>cmp</span>(<span class='kw-2'>&</span><span class='ident'>seek</span>)), <span class='prelude-val'>Ok</span>(<span class='number'>9</span>)); |
| 1070 |
<span class='kw'>let</span> <span class='ident'>seek</span> <span class='op'>=</span> <span class='number'>4</span>; |
| 1071 |
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>s</span>.<span class='ident'>binary_search_by</span>(<span class='op'>|</span><span class='ident'>probe</span><span class='op'>|</span> <span class='ident'>probe</span>.<span class='ident'>cmp</span>(<span class='kw-2'>&</span><span class='ident'>seek</span>)), <span class='prelude-val'>Err</span>(<span class='number'>7</span>)); |
| 1072 |
<span class='kw'>let</span> <span class='ident'>seek</span> <span class='op'>=</span> <span class='number'>100</span>; |
| 1073 |
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>s</span>.<span class='ident'>binary_search_by</span>(<span class='op'>|</span><span class='ident'>probe</span><span class='op'>|</span> <span class='ident'>probe</span>.<span class='ident'>cmp</span>(<span class='kw-2'>&</span><span class='ident'>seek</span>)), <span class='prelude-val'>Err</span>(<span class='number'>13</span>)); |
| 1074 |
<span class='kw'>let</span> <span class='ident'>seek</span> <span class='op'>=</span> <span class='number'>1</span>; |
| 1075 |
<span class='kw'>let</span> <span class='ident'>r</span> <span class='op'>=</span> <span class='ident'>s</span>.<span class='ident'>binary_search_by</span>(<span class='op'>|</span><span class='ident'>probe</span><span class='op'>|</span> <span class='ident'>probe</span>.<span class='ident'>cmp</span>(<span class='kw-2'>&</span><span class='ident'>seek</span>)); |
| 1076 |
<span class='macro'>assert</span><span class='macro'>!</span>(<span class='kw'>match</span> <span class='ident'>r</span> { <span class='prelude-val'>Ok</span>(<span class='number'>1</span>...<span class='number'>4</span>) <span class='op'>=></span> <span class='boolval'>true</span>, _ <span class='op'>=></span> <span class='boolval'>false</span>, }); |
| 1077 |
</pre> |
| 1078 |
</div><h4 id='method.len' class='method'><code>fn <a href='#method.len' class='fnname'>len</a>(&self) -> <a href='../../core/primitive.usize.html'>usize</a></code></h4> |
| 1079 |
<div class='docblock'><p>Returns the number of elements in the slice.</p> |
| 1080 |
|
| 1081 |
<h1 id="example" class='section-header'><a |
| 1082 |
href="#example">Example</a></h1><span class='rusttest'>fn main() { |
| 1083 |
let a = [1, 2, 3]; |
| 1084 |
assert_eq!(a.len(), 3); |
| 1085 |
|
| 1086 |
}</span><pre id='rust-example-rendered' class='rust '> |
| 1087 |
<span class='kw'>let</span> <span class='ident'>a</span> <span class='op'>=</span> [<span class='number'>1</span>, <span class='number'>2</span>, <span class='number'>3</span>]; |
| 1088 |
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>a</span>.<span class='ident'>len</span>(), <span class='number'>3</span>); |
| 1089 |
</pre> |
| 1090 |
</div><h4 id='method.is_empty' class='method'><code>fn <a href='#method.is_empty' class='fnname'>is_empty</a>(&self) -> <a href='../../core/primitive.bool.html'>bool</a></code></h4> |
| 1091 |
<div class='docblock'><p>Returns true if the slice has a length of 0</p> |
| 1092 |
|
| 1093 |
<h1 id="example" class='section-header'><a |
| 1094 |
href="#example">Example</a></h1><span class='rusttest'>fn main() { |
| 1095 |
let a = [1, 2, 3]; |
| 1096 |
assert!(!a.is_empty()); |
| 1097 |
|
| 1098 |
}</span><pre id='rust-example-rendered' class='rust '> |
| 1099 |
<span class='kw'>let</span> <span class='ident'>a</span> <span class='op'>=</span> [<span class='number'>1</span>, <span class='number'>2</span>, <span class='number'>3</span>]; |
| 1100 |
<span class='macro'>assert</span><span class='macro'>!</span>(<span class='op'>!</span><span class='ident'>a</span>.<span class='ident'>is_empty</span>()); |
| 1101 |
</pre> |
| 1102 |
</div><h4 id='method.get_mut' class='method'><code>fn <a href='#method.get_mut' class='fnname'>get_mut</a>(&mut self, index: <a href='../../core/primitive.usize.html'>usize</a>) -> <a class='enum' href='../../core/option/enum.Option.html' title='core::option::Option'>Option</a><&mut T></code></h4> |
| 1103 |
<div class='docblock'><p>Returns a mutable reference to the element at the given index, |
| 1104 |
or <code>None</code> if the index is out of bounds</p> |
| 1105 |
</div><h4 id='method.iter_mut' class='method'><code>fn <a href='#method.iter_mut' class='fnname'>iter_mut</a>(&mut self) -> <a class='struct' href='../../collections/slice/struct.IterMut.html' title='collections::slice::IterMut'>IterMut</a><T></code></h4> |
| 1106 |
<div class='docblock'><p>Returns an iterator that allows modifying each value</p> |
| 1107 |
</div><h4 id='method.first_mut' class='method'><code>fn <a href='#method.first_mut' class='fnname'>first_mut</a>(&mut self) -> <a class='enum' href='../../core/option/enum.Option.html' title='core::option::Option'>Option</a><&mut T></code></h4> |
| 1108 |
<div class='docblock'><p>Returns a mutable pointer to the first element of a slice, or <code>None</code> if it is empty</p> |
| 1109 |
</div><h4 id='method.tail_mut' class='method'><code>fn <a href='#method.tail_mut' class='fnname'>tail_mut</a>(&mut self) -> <a href='../primitive.slice.html'>&mut [T]</a></code></h4> |
| 1110 |
<div class='stability'><em class='stab unstable'>Unstable<p>: likely to be renamed or removed</p> |
| 1111 |
</em></div><div class='docblock'><p>Returns all but the first element of a mutable slice</p> |
| 1112 |
</div><h4 id='method.init_mut' class='method'><code>fn <a href='#method.init_mut' class='fnname'>init_mut</a>(&mut self) -> <a href='../primitive.slice.html'>&mut [T]</a></code></h4> |
| 1113 |
<div class='stability'><em class='stab unstable'>Unstable<p>: likely to be renamed or removed</p> |
| 1114 |
</em></div><div class='docblock'><p>Returns all but the last element of a mutable slice</p> |
| 1115 |
</div><h4 id='method.last_mut' class='method'><code>fn <a href='#method.last_mut' class='fnname'>last_mut</a>(&mut self) -> <a class='enum' href='../../core/option/enum.Option.html' title='core::option::Option'>Option</a><&mut T></code></h4> |
| 1116 |
<div class='docblock'><p>Returns a mutable pointer to the last item in the slice.</p> |
| 1117 |
</div><h4 id='method.split_mut' class='method'><code>fn <a href='#method.split_mut' class='fnname'>split_mut</a><F>(&mut self, pred: F) -> <a class='struct' href='../../collections/slice/struct.SplitMut.html' title='collections::slice::SplitMut'>SplitMut</a><T, F> <span class='where'>where F: <a class='trait' href='../../core/ops/trait.FnMut.html' title='core::ops::FnMut'>FnMut</a>(&T) -> <a href='../../core/primitive.bool.html'>bool</a></span></code></h4> |
| 1118 |
<div class='docblock'><p>Returns an iterator over mutable subslices separated by elements that |
| 1119 |
match <code>pred</code>. The matched element is not contained in the subslices.</p> |
| 1120 |
</div><h4 id='method.splitn_mut' class='method'><code>fn <a href='#method.splitn_mut' class='fnname'>splitn_mut</a><F>(&mut self, n: <a href='../../core/primitive.usize.html'>usize</a>, pred: F) -> <a class='struct' href='../../collections/slice/struct.SplitNMut.html' title='collections::slice::SplitNMut'>SplitNMut</a><T, F> <span class='where'>where F: <a class='trait' href='../../core/ops/trait.FnMut.html' title='core::ops::FnMut'>FnMut</a>(&T) -> <a href='../../core/primitive.bool.html'>bool</a></span></code></h4> |
| 1121 |
<div class='docblock'><p>Returns an iterator over subslices separated by elements that match |
| 1122 |
<code>pred</code>, limited to returning at most <code>n</code> items. The matched element is |
| 1123 |
not contained in the subslices.</p> |
| 1124 |
|
| 1125 |
<p>The last element returned, if any, will contain the remainder of the |
| 1126 |
slice.</p> |
| 1127 |
</div><h4 id='method.rsplitn_mut' class='method'><code>fn <a href='#method.rsplitn_mut' class='fnname'>rsplitn_mut</a><F>(&mut self, n: <a href='../../core/primitive.usize.html'>usize</a>, pred: F) -> <a class='struct' href='../../collections/slice/struct.RSplitNMut.html' title='collections::slice::RSplitNMut'>RSplitNMut</a><T, F> <span class='where'>where F: <a class='trait' href='../../core/ops/trait.FnMut.html' title='core::ops::FnMut'>FnMut</a>(&T) -> <a href='../../core/primitive.bool.html'>bool</a></span></code></h4> |
| 1128 |
<div class='docblock'><p>Returns an iterator over subslices separated by elements that match |
| 1129 |
<code>pred</code> limited to returning at most <code>n</code> items. This starts at the end of |
| 1130 |
the slice and works backwards. The matched element is not contained in |
| 1131 |
the subslices.</p> |
| 1132 |
|
| 1133 |
<p>The last element returned, if any, will contain the remainder of the |
| 1134 |
slice.</p> |
| 1135 |
</div><h4 id='method.chunks_mut' class='method'><code>fn <a href='#method.chunks_mut' class='fnname'>chunks_mut</a>(&mut self, chunk_size: <a href='../../core/primitive.usize.html'>usize</a>) -> <a class='struct' href='../../collections/slice/struct.ChunksMut.html' title='collections::slice::ChunksMut'>ChunksMut</a><T></code></h4> |
| 1136 |
<div class='docblock'><p>Returns an iterator over <code>chunk_size</code> elements of the slice at a time. |
| 1137 |
The chunks are mutable and do not overlap. If <code>chunk_size</code> does |
| 1138 |
not divide the length of the slice, then the last chunk will not |
| 1139 |
have length <code>chunk_size</code>.</p> |
| 1140 |
|
| 1141 |
<h1 id="panics" class='section-header'><a |
| 1142 |
href="#panics">Panics</a></h1> |
| 1143 |
<p>Panics if <code>chunk_size</code> is 0.</p> |
| 1144 |
</div><h4 id='method.swap' class='method'><code>fn <a href='#method.swap' class='fnname'>swap</a>(&mut self, a: <a href='../../core/primitive.usize.html'>usize</a>, b: <a href='../../core/primitive.usize.html'>usize</a>)</code></h4> |
| 1145 |
<div class='docblock'><p>Swaps two elements in a slice.</p> |
| 1146 |
|
| 1147 |
<h1 id="arguments" class='section-header'><a |
| 1148 |
href="#arguments">Arguments</a></h1> |
| 1149 |
<ul> |
| 1150 |
<li>a - The index of the first element</li> |
| 1151 |
<li>b - The index of the second element</li> |
| 1152 |
</ul> |
| 1153 |
|
| 1154 |
<h1 id="panics" class='section-header'><a |
| 1155 |
href="#panics">Panics</a></h1> |
| 1156 |
<p>Panics if <code>a</code> or <code>b</code> are out of bounds.</p> |
| 1157 |
|
| 1158 |
<h1 id="example" class='section-header'><a |
| 1159 |
href="#example">Example</a></h1><span class='rusttest'>fn main() { |
| 1160 |
let mut v = ["a", "b", "c", "d"]; |
| 1161 |
v.swap(1, 3); |
| 1162 |
assert!(v == ["a", "d", "c", "b"]); |
| 1163 |
|
| 1164 |
}</span><pre id='rust-example-rendered' class='rust '> |
| 1165 |
<span class='kw'>let</span> <span class='kw-2'>mut</span> <span class='ident'>v</span> <span class='op'>=</span> [<span class='string'>"a"</span>, <span class='string'>"b"</span>, <span class='string'>"c"</span>, <span class='string'>"d"</span>]; |
| 1166 |
<span class='ident'>v</span>.<span class='ident'>swap</span>(<span class='number'>1</span>, <span class='number'>3</span>); |
| 1167 |
<span class='macro'>assert</span><span class='macro'>!</span>(<span class='ident'>v</span> <span class='op'>==</span> [<span class='string'>"a"</span>, <span class='string'>"d"</span>, <span class='string'>"c"</span>, <span class='string'>"b"</span>]); |
| 1168 |
</pre> |
| 1169 |
</div><h4 id='method.split_at_mut' class='method'><code>fn <a href='#method.split_at_mut' class='fnname'>split_at_mut</a>(&mut self, mid: <a href='../../core/primitive.usize.html'>usize</a>) -> <a href='../../core/primitive.tuple.html'>(<a href='../primitive.slice.html'>&mut [T]</a>, <a href='../primitive.slice.html'>&mut [T]</a>)</a></code></h4> |
| 1170 |
<div class='docblock'><p>Divides one <code>&mut</code> into two at an index.</p> |
| 1171 |
|
| 1172 |
<p>The first will contain all indices from <code>[0, mid)</code> (excluding |
| 1173 |
the index <code>mid</code> itself) and the second will contain all |
| 1174 |
indices from <code>[mid, len)</code> (excluding the index <code>len</code> itself).</p> |
| 1175 |
|
| 1176 |
<h1 id="panics" class='section-header'><a |
| 1177 |
href="#panics">Panics</a></h1> |
| 1178 |
<p>Panics if <code>mid > len</code>.</p> |
| 1179 |
|
| 1180 |
<h1 id="example" class='section-header'><a |
| 1181 |
href="#example">Example</a></h1><span class='rusttest'>fn main() { |
| 1182 |
let mut v = [1, 2, 3, 4, 5, 6]; |
| 1183 |
|
| 1184 |
// scoped to restrict the lifetime of the borrows |
| 1185 |
{ |
| 1186 |
let (left, right) = v.split_at_mut(0); |
| 1187 |
assert!(left == []); |
| 1188 |
assert!(right == [1, 2, 3, 4, 5, 6]); |
| 1189 |
} |
| 1190 |
|
| 1191 |
{ |
| 1192 |
let (left, right) = v.split_at_mut(2); |
| 1193 |
assert!(left == [1, 2]); |
| 1194 |
assert!(right == [3, 4, 5, 6]); |
| 1195 |
} |
| 1196 |
|
| 1197 |
{ |
| 1198 |
let (left, right) = v.split_at_mut(6); |
| 1199 |
assert!(left == [1, 2, 3, 4, 5, 6]); |
| 1200 |
assert!(right == []); |
| 1201 |
} |
| 1202 |
|
| 1203 |
}</span><pre id='rust-example-rendered' class='rust '> |
| 1204 |
<span class='kw'>let</span> <span class='kw-2'>mut</span> <span class='ident'>v</span> <span class='op'>=</span> [<span class='number'>1</span>, <span class='number'>2</span>, <span class='number'>3</span>, <span class='number'>4</span>, <span class='number'>5</span>, <span class='number'>6</span>]; |
| 1205 |
|
| 1206 |
<span class='comment'>// scoped to restrict the lifetime of the borrows</span> |
| 1207 |
{ |
| 1208 |
<span class='kw'>let</span> (<span class='ident'>left</span>, <span class='ident'>right</span>) <span class='op'>=</span> <span class='ident'>v</span>.<span class='ident'>split_at_mut</span>(<span class='number'>0</span>); |
| 1209 |
<span class='macro'>assert</span><span class='macro'>!</span>(<span class='ident'>left</span> <span class='op'>==</span> []); |
| 1210 |
<span class='macro'>assert</span><span class='macro'>!</span>(<span class='ident'>right</span> <span class='op'>==</span> [<span class='number'>1</span>, <span class='number'>2</span>, <span class='number'>3</span>, <span class='number'>4</span>, <span class='number'>5</span>, <span class='number'>6</span>]); |
| 1211 |
} |
| 1212 |
|
| 1213 |
{ |
| 1214 |
<span class='kw'>let</span> (<span class='ident'>left</span>, <span class='ident'>right</span>) <span class='op'>=</span> <span class='ident'>v</span>.<span class='ident'>split_at_mut</span>(<span class='number'>2</span>); |
| 1215 |
<span class='macro'>assert</span><span class='macro'>!</span>(<span class='ident'>left</span> <span class='op'>==</span> [<span class='number'>1</span>, <span class='number'>2</span>]); |
| 1216 |
<span class='macro'>assert</span><span class='macro'>!</span>(<span class='ident'>right</span> <span class='op'>==</span> [<span class='number'>3</span>, <span class='number'>4</span>, <span class='number'>5</span>, <span class='number'>6</span>]); |
| 1217 |
} |
| 1218 |
|
| 1219 |
{ |
| 1220 |
<span class='kw'>let</span> (<span class='ident'>left</span>, <span class='ident'>right</span>) <span class='op'>=</span> <span class='ident'>v</span>.<span class='ident'>split_at_mut</span>(<span class='number'>6</span>); |
| 1221 |
<span class='macro'>assert</span><span class='macro'>!</span>(<span class='ident'>left</span> <span class='op'>==</span> [<span class='number'>1</span>, <span class='number'>2</span>, <span class='number'>3</span>, <span class='number'>4</span>, <span class='number'>5</span>, <span class='number'>6</span>]); |
| 1222 |
<span class='macro'>assert</span><span class='macro'>!</span>(<span class='ident'>right</span> <span class='op'>==</span> []); |
| 1223 |
} |
| 1224 |
</pre> |
| 1225 |
</div><h4 id='method.reverse' class='method'><code>fn <a href='#method.reverse' class='fnname'>reverse</a>(&mut self)</code></h4> |
| 1226 |
<div class='docblock'><p>Reverse the order of elements in a slice, in place.</p> |
| 1227 |
|
| 1228 |
<h1 id="example" class='section-header'><a |
| 1229 |
href="#example">Example</a></h1><span class='rusttest'>fn main() { |
| 1230 |
let mut v = [1, 2, 3]; |
| 1231 |
v.reverse(); |
| 1232 |
assert!(v == [3, 2, 1]); |
| 1233 |
|
| 1234 |
}</span><pre id='rust-example-rendered' class='rust '> |
| 1235 |
<span class='kw'>let</span> <span class='kw-2'>mut</span> <span class='ident'>v</span> <span class='op'>=</span> [<span class='number'>1</span>, <span class='number'>2</span>, <span class='number'>3</span>]; |
| 1236 |
<span class='ident'>v</span>.<span class='ident'>reverse</span>(); |
| 1237 |
<span class='macro'>assert</span><span class='macro'>!</span>(<span class='ident'>v</span> <span class='op'>==</span> [<span class='number'>3</span>, <span class='number'>2</span>, <span class='number'>1</span>]); |
| 1238 |
</pre> |
| 1239 |
</div><h4 id='method.get_unchecked_mut' class='method'><code>unsafe fn <a href='#method.get_unchecked_mut' class='fnname'>get_unchecked_mut</a>(&mut self, index: <a href='../../core/primitive.usize.html'>usize</a>) -> &mut T</code></h4> |
| 1240 |
<div class='docblock'><p>Returns an unsafe mutable pointer to the element in index</p> |
| 1241 |
</div><h4 id='method.as_mut_ptr' class='method'><code>fn <a href='#method.as_mut_ptr' class='fnname'>as_mut_ptr</a>(&mut self) -> <a href='../../core/primitive.pointer.html'>*mut T</a></code></h4> |
| 1242 |
<div class='docblock'><p>Returns an unsafe mutable pointer to the slice's buffer.</p> |
| 1243 |
|
| 1244 |
<p>The caller must ensure that the slice outlives the pointer this |
| 1245 |
function returns, or else it will end up pointing to garbage.</p> |
| 1246 |
|
| 1247 |
<p>Modifying the slice may cause its buffer to be reallocated, which |
| 1248 |
would also make any pointers to it invalid.</p> |
| 1249 |
</div><h4 id='method.to_vec' class='method'><code>fn <a href='#method.to_vec' class='fnname'>to_vec</a>(&self) -> <a class='struct' href='../../collections/vec/struct.Vec.html' title='collections::vec::Vec'>Vec</a><T> <span class='where'>where T: <a class='trait' href='../../core/clone/trait.Clone.html' title='core::clone::Clone'>Clone</a></span></code></h4> |
| 1250 |
<div class='docblock'><p>Copies <code>self</code> into a new <code>Vec</code>.</p> |
| 1251 |
</div><h4 id='method.permutations' class='method'><code>fn <a href='#method.permutations' class='fnname'>permutations</a>(&self) -> <a class='struct' href='../../collections/slice/struct.Permutations.html' title='collections::slice::Permutations'>Permutations</a><T> <span class='where'>where T: <a class='trait' href='../../core/clone/trait.Clone.html' title='core::clone::Clone'>Clone</a></span></code></h4> |
| 1252 |
<div class='stability'><em class='stab unstable'>Unstable</em></div><div class='docblock'><p>Creates an iterator that yields every possible permutation of the |
| 1253 |
vector in succession.</p> |
| 1254 |
|
| 1255 |
<h1 id="examples" class='section-header'><a |
| 1256 |
href="#examples">Examples</a></h1><span class='rusttest'>#![feature(collections)] |
| 1257 |
extern crate collections; |
| 1258 |
fn main() { |
| 1259 |
let v = [1, 2, 3]; |
| 1260 |
let mut perms = v.permutations(); |
| 1261 |
|
| 1262 |
for p in perms { |
| 1263 |
println!("{:?}", p); |
| 1264 |
} |
| 1265 |
|
| 1266 |
}</span><pre id='rust-example-rendered' class='rust '> |
| 1267 |
<span class='kw'>let</span> <span class='ident'>v</span> <span class='op'>=</span> [<span class='number'>1</span>, <span class='number'>2</span>, <span class='number'>3</span>]; |
| 1268 |
<span class='kw'>let</span> <span class='kw-2'>mut</span> <span class='ident'>perms</span> <span class='op'>=</span> <span class='ident'>v</span>.<span class='ident'>permutations</span>(); |
| 1269 |
|
| 1270 |
<span class='kw'>for</span> <span class='ident'>p</span> <span class='kw'>in</span> <span class='ident'>perms</span> { |
| 1271 |
<span class='macro'>println</span><span class='macro'>!</span>(<span class='string'>"{:?}"</span>, <span class='ident'>p</span>); |
| 1272 |
} |
| 1273 |
</pre> |
| 1274 |
|
| 1275 |
<p>Iterating through permutations one by one.</p> |
| 1276 |
<span class='rusttest'>#![feature(collections)] |
| 1277 |
extern crate collections; |
| 1278 |
fn main() { |
| 1279 |
let v = [1, 2, 3]; |
| 1280 |
let mut perms = v.permutations(); |
| 1281 |
|
| 1282 |
assert_eq!(Some(vec![1, 2, 3]), perms.next()); |
| 1283 |
assert_eq!(Some(vec![1, 3, 2]), perms.next()); |
| 1284 |
assert_eq!(Some(vec![3, 1, 2]), perms.next()); |
| 1285 |
|
| 1286 |
}</span><pre id='rust-example-rendered' class='rust '> |
| 1287 |
<span class='kw'>let</span> <span class='ident'>v</span> <span class='op'>=</span> [<span class='number'>1</span>, <span class='number'>2</span>, <span class='number'>3</span>]; |
| 1288 |
<span class='kw'>let</span> <span class='kw-2'>mut</span> <span class='ident'>perms</span> <span class='op'>=</span> <span class='ident'>v</span>.<span class='ident'>permutations</span>(); |
| 1289 |
|
| 1290 |
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='prelude-val'>Some</span>(<span class='macro'>vec</span><span class='macro'>!</span>[<span class='number'>1</span>, <span class='number'>2</span>, <span class='number'>3</span>]), <span class='ident'>perms</span>.<span class='ident'>next</span>()); |
| 1291 |
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='prelude-val'>Some</span>(<span class='macro'>vec</span><span class='macro'>!</span>[<span class='number'>1</span>, <span class='number'>3</span>, <span class='number'>2</span>]), <span class='ident'>perms</span>.<span class='ident'>next</span>()); |
| 1292 |
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='prelude-val'>Some</span>(<span class='macro'>vec</span><span class='macro'>!</span>[<span class='number'>3</span>, <span class='number'>1</span>, <span class='number'>2</span>]), <span class='ident'>perms</span>.<span class='ident'>next</span>()); |
| 1293 |
</pre> |
| 1294 |
</div><h4 id='method.clone_from_slice' class='method'><code>fn <a href='#method.clone_from_slice' class='fnname'>clone_from_slice</a>(&mut self, src: <a href='../primitive.slice.html'>&[T]</a>) -> <a href='../../core/primitive.usize.html'>usize</a> <span class='where'>where T: <a class='trait' href='../../core/clone/trait.Clone.html' title='core::clone::Clone'>Clone</a></span></code></h4> |
| 1295 |
<div class='stability'><em class='stab unstable'>Unstable</em></div><div class='docblock'><p>Copies as many elements from <code>src</code> as it can into <code>self</code> (the |
| 1296 |
shorter of <code>self.len()</code> and <code>src.len()</code>). Returns the number |
| 1297 |
of elements copied.</p> |
| 1298 |
|
| 1299 |
<h1 id="example" class='section-header'><a |
| 1300 |
href="#example">Example</a></h1><span class='rusttest'>#![feature(collections)] |
| 1301 |
extern crate collections; |
| 1302 |
fn main() { |
| 1303 |
let mut dst = [0, 0, 0]; |
| 1304 |
let src = [1, 2]; |
| 1305 |
|
| 1306 |
assert!(dst.clone_from_slice(&src) == 2); |
| 1307 |
assert!(dst == [1, 2, 0]); |
| 1308 |
|
| 1309 |
let src2 = [3, 4, 5, 6]; |
| 1310 |
assert!(dst.clone_from_slice(&src2) == 3); |
| 1311 |
assert!(dst == [3, 4, 5]); |
| 1312 |
|
| 1313 |
}</span><pre id='rust-example-rendered' class='rust '> |
| 1314 |
<span class='kw'>let</span> <span class='kw-2'>mut</span> <span class='ident'>dst</span> <span class='op'>=</span> [<span class='number'>0</span>, <span class='number'>0</span>, <span class='number'>0</span>]; |
| 1315 |
<span class='kw'>let</span> <span class='ident'>src</span> <span class='op'>=</span> [<span class='number'>1</span>, <span class='number'>2</span>]; |
| 1316 |
|
| 1317 |
<span class='macro'>assert</span><span class='macro'>!</span>(<span class='ident'>dst</span>.<span class='ident'>clone_from_slice</span>(<span class='kw-2'>&</span><span class='ident'>src</span>) <span class='op'>==</span> <span class='number'>2</span>); |
| 1318 |
<span class='macro'>assert</span><span class='macro'>!</span>(<span class='ident'>dst</span> <span class='op'>==</span> [<span class='number'>1</span>, <span class='number'>2</span>, <span class='number'>0</span>]); |
| 1319 |
|
| 1320 |
<span class='kw'>let</span> <span class='ident'>src2</span> <span class='op'>=</span> [<span class='number'>3</span>, <span class='number'>4</span>, <span class='number'>5</span>, <span class='number'>6</span>]; |
| 1321 |
<span class='macro'>assert</span><span class='macro'>!</span>(<span class='ident'>dst</span>.<span class='ident'>clone_from_slice</span>(<span class='kw-2'>&</span><span class='ident'>src2</span>) <span class='op'>==</span> <span class='number'>3</span>); |
| 1322 |
<span class='macro'>assert</span><span class='macro'>!</span>(<span class='ident'>dst</span> <span class='op'>==</span> [<span class='number'>3</span>, <span class='number'>4</span>, <span class='number'>5</span>]); |
| 1323 |
</pre> |
| 1324 |
</div><h4 id='method.sort' class='method'><code>fn <a href='#method.sort' class='fnname'>sort</a>(&mut self) <span class='where'>where T: <a class='trait' href='../../core/cmp/trait.Ord.html' title='core::cmp::Ord'>Ord</a></span></code></h4> |
| 1325 |
<div class='docblock'><p>Sorts the slice, in place.</p> |
| 1326 |
|
| 1327 |
<p>This is equivalent to <code>self.sort_by(|a, b| a.cmp(b))</code>.</p> |
| 1328 |
|
| 1329 |
<h1 id="examples" class='section-header'><a |
| 1330 |
href="#examples">Examples</a></h1><span class='rusttest'>fn main() { |
| 1331 |
let mut v = [-5, 4, 1, -3, 2]; |
| 1332 |
|
| 1333 |
v.sort(); |
| 1334 |
assert!(v == [-5, -3, 1, 2, 4]); |
| 1335 |
|
| 1336 |
}</span><pre id='rust-example-rendered' class='rust '> |
| 1337 |
<span class='kw'>let</span> <span class='kw-2'>mut</span> <span class='ident'>v</span> <span class='op'>=</span> [<span class='op'>-</span><span class='number'>5</span>, <span class='number'>4</span>, <span class='number'>1</span>, <span class='op'>-</span><span class='number'>3</span>, <span class='number'>2</span>]; |
| 1338 |
|
| 1339 |
<span class='ident'>v</span>.<span class='ident'>sort</span>(); |
| 1340 |
<span class='macro'>assert</span><span class='macro'>!</span>(<span class='ident'>v</span> <span class='op'>==</span> [<span class='op'>-</span><span class='number'>5</span>, <span class='op'>-</span><span class='number'>3</span>, <span class='number'>1</span>, <span class='number'>2</span>, <span class='number'>4</span>]); |
| 1341 |
</pre> |
| 1342 |
</div><h4 id='method.binary_search' class='method'><code>fn <a href='#method.binary_search' class='fnname'>binary_search</a>(&self, x: &T) -> <a class='enum' href='../../core/result/enum.Result.html' title='core::result::Result'>Result</a><<a href='../../core/primitive.usize.html'>usize</a>, <a href='../../core/primitive.usize.html'>usize</a>> <span class='where'>where T: <a class='trait' href='../../core/cmp/trait.Ord.html' title='core::cmp::Ord'>Ord</a></span></code></h4> |
| 1343 |
<div class='docblock'><p>Binary search a sorted slice for a given element.</p> |
| 1344 |
|
| 1345 |
<p>If the value is found then <code>Ok</code> is returned, containing the |
| 1346 |
index of the matching element; if the value is not found then |
| 1347 |
<code>Err</code> is returned, containing the index where a matching |
| 1348 |
element could be inserted while maintaining sorted order.</p> |
| 1349 |
|
| 1350 |
<h1 id="example" class='section-header'><a |
| 1351 |
href="#example">Example</a></h1> |
| 1352 |
<p>Looks up a series of four elements. The first is found, with a |
| 1353 |
uniquely determined position; the second and third are not |
| 1354 |
found; the fourth could match any position in <code>[1,4]</code>.</p> |
| 1355 |
<span class='rusttest'>#![feature(core)] |
| 1356 |
fn main() { |
| 1357 |
let s = [0, 1, 1, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55]; |
| 1358 |
|
| 1359 |
assert_eq!(s.binary_search(&13), Ok(9)); |
| 1360 |
assert_eq!(s.binary_search(&4), Err(7)); |
| 1361 |
assert_eq!(s.binary_search(&100), Err(13)); |
| 1362 |
let r = s.binary_search(&1); |
| 1363 |
assert!(match r { Ok(1...4) => true, _ => false, }); |
| 1364 |
|
| 1365 |
}</span><pre id='rust-example-rendered' class='rust '> |
| 1366 |
<span class='kw'>let</span> <span class='ident'>s</span> <span class='op'>=</span> [<span class='number'>0</span>, <span class='number'>1</span>, <span class='number'>1</span>, <span class='number'>1</span>, <span class='number'>1</span>, <span class='number'>2</span>, <span class='number'>3</span>, <span class='number'>5</span>, <span class='number'>8</span>, <span class='number'>13</span>, <span class='number'>21</span>, <span class='number'>34</span>, <span class='number'>55</span>]; |
| 1367 |
|
| 1368 |
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>s</span>.<span class='ident'>binary_search</span>(<span class='kw-2'>&</span><span class='number'>13</span>), <span class='prelude-val'>Ok</span>(<span class='number'>9</span>)); |
| 1369 |
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>s</span>.<span class='ident'>binary_search</span>(<span class='kw-2'>&</span><span class='number'>4</span>), <span class='prelude-val'>Err</span>(<span class='number'>7</span>)); |
| 1370 |
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>s</span>.<span class='ident'>binary_search</span>(<span class='kw-2'>&</span><span class='number'>100</span>), <span class='prelude-val'>Err</span>(<span class='number'>13</span>)); |
| 1371 |
<span class='kw'>let</span> <span class='ident'>r</span> <span class='op'>=</span> <span class='ident'>s</span>.<span class='ident'>binary_search</span>(<span class='kw-2'>&</span><span class='number'>1</span>); |
| 1372 |
<span class='macro'>assert</span><span class='macro'>!</span>(<span class='kw'>match</span> <span class='ident'>r</span> { <span class='prelude-val'>Ok</span>(<span class='number'>1</span>...<span class='number'>4</span>) <span class='op'>=></span> <span class='boolval'>true</span>, _ <span class='op'>=></span> <span class='boolval'>false</span>, }); |
| 1373 |
</pre> |
| 1374 |
</div><h4 id='method.next_permutation' class='method'><code>fn <a href='#method.next_permutation' class='fnname'>next_permutation</a>(&mut self) -> <a href='../../core/primitive.bool.html'>bool</a> <span class='where'>where T: <a class='trait' href='../../core/cmp/trait.Ord.html' title='core::cmp::Ord'>Ord</a></span></code></h4> |
| 1375 |
<div class='stability'><em class='stab unstable'>Unstable<p>: uncertain if this merits inclusion in std</p> |
| 1376 |
</em></div><div class='docblock'><p>Mutates the slice to the next lexicographic permutation.</p> |
| 1377 |
|
| 1378 |
<p>Returns <code>true</code> if successful and <code>false</code> if the slice is at the |
| 1379 |
last-ordered permutation.</p> |
| 1380 |
|
| 1381 |
<h1 id="example" class='section-header'><a |
| 1382 |
href="#example">Example</a></h1><span class='rusttest'>#![feature(collections)] |
| 1383 |
extern crate collections; |
| 1384 |
fn main() { |
| 1385 |
let v: &mut [_] = &mut [0, 1, 2]; |
| 1386 |
v.next_permutation(); |
| 1387 |
let b: &mut [_] = &mut [0, 2, 1]; |
| 1388 |
assert!(v == b); |
| 1389 |
v.next_permutation(); |
| 1390 |
let b: &mut [_] = &mut [1, 0, 2]; |
| 1391 |
assert!(v == b); |
| 1392 |
|
| 1393 |
}</span><pre id='rust-example-rendered' class='rust '> |
| 1394 |
<span class='kw'>let</span> <span class='ident'>v</span>: <span class='kw-2'>&</span><span class='kw-2'>mut</span> [_] <span class='op'>=</span> <span class='kw-2'>&</span><span class='kw-2'>mut</span> [<span class='number'>0</span>, <span class='number'>1</span>, <span class='number'>2</span>]; |
| 1395 |
<span class='ident'>v</span>.<span class='ident'>next_permutation</span>(); |
| 1396 |
<span class='kw'>let</span> <span class='ident'>b</span>: <span class='kw-2'>&</span><span class='kw-2'>mut</span> [_] <span class='op'>=</span> <span class='kw-2'>&</span><span class='kw-2'>mut</span> [<span class='number'>0</span>, <span class='number'>2</span>, <span class='number'>1</span>]; |
| 1397 |
<span class='macro'>assert</span><span class='macro'>!</span>(<span class='ident'>v</span> <span class='op'>==</span> <span class='ident'>b</span>); |
| 1398 |
<span class='ident'>v</span>.<span class='ident'>next_permutation</span>(); |
| 1399 |
<span class='kw'>let</span> <span class='ident'>b</span>: <span class='kw-2'>&</span><span class='kw-2'>mut</span> [_] <span class='op'>=</span> <span class='kw-2'>&</span><span class='kw-2'>mut</span> [<span class='number'>1</span>, <span class='number'>0</span>, <span class='number'>2</span>]; |
| 1400 |
<span class='macro'>assert</span><span class='macro'>!</span>(<span class='ident'>v</span> <span class='op'>==</span> <span class='ident'>b</span>); |
| 1401 |
</pre> |
| 1402 |
</div><h4 id='method.prev_permutation' class='method'><code>fn <a href='#method.prev_permutation' class='fnname'>prev_permutation</a>(&mut self) -> <a href='../../core/primitive.bool.html'>bool</a> <span class='where'>where T: <a class='trait' href='../../core/cmp/trait.Ord.html' title='core::cmp::Ord'>Ord</a></span></code></h4> |
| 1403 |
<div class='stability'><em class='stab unstable'>Unstable<p>: uncertain if this merits inclusion in std</p> |
| 1404 |
</em></div><div class='docblock'><p>Mutates the slice to the previous lexicographic permutation.</p> |
| 1405 |
|
| 1406 |
<p>Returns <code>true</code> if successful and <code>false</code> if the slice is at the |
| 1407 |
first-ordered permutation.</p> |
| 1408 |
|
| 1409 |
<h1 id="example" class='section-header'><a |
| 1410 |
href="#example">Example</a></h1><span class='rusttest'>#![feature(collections)] |
| 1411 |
extern crate collections; |
| 1412 |
fn main() { |
| 1413 |
let v: &mut [_] = &mut [1, 0, 2]; |
| 1414 |
v.prev_permutation(); |
| 1415 |
let b: &mut [_] = &mut [0, 2, 1]; |
| 1416 |
assert!(v == b); |
| 1417 |
v.prev_permutation(); |
| 1418 |
let b: &mut [_] = &mut [0, 1, 2]; |
| 1419 |
assert!(v == b); |
| 1420 |
|
| 1421 |
}</span><pre id='rust-example-rendered' class='rust '> |
| 1422 |
<span class='kw'>let</span> <span class='ident'>v</span>: <span class='kw-2'>&</span><span class='kw-2'>mut</span> [_] <span class='op'>=</span> <span class='kw-2'>&</span><span class='kw-2'>mut</span> [<span class='number'>1</span>, <span class='number'>0</span>, <span class='number'>2</span>]; |
| 1423 |
<span class='ident'>v</span>.<span class='ident'>prev_permutation</span>(); |
| 1424 |
<span class='kw'>let</span> <span class='ident'>b</span>: <span class='kw-2'>&</span><span class='kw-2'>mut</span> [_] <span class='op'>=</span> <span class='kw-2'>&</span><span class='kw-2'>mut</span> [<span class='number'>0</span>, <span class='number'>2</span>, <span class='number'>1</span>]; |
| 1425 |
<span class='macro'>assert</span><span class='macro'>!</span>(<span class='ident'>v</span> <span class='op'>==</span> <span class='ident'>b</span>); |
| 1426 |
<span class='ident'>v</span>.<span class='ident'>prev_permutation</span>(); |
| 1427 |
<span class='kw'>let</span> <span class='ident'>b</span>: <span class='kw-2'>&</span><span class='kw-2'>mut</span> [_] <span class='op'>=</span> <span class='kw-2'>&</span><span class='kw-2'>mut</span> [<span class='number'>0</span>, <span class='number'>1</span>, <span class='number'>2</span>]; |
| 1428 |
<span class='macro'>assert</span><span class='macro'>!</span>(<span class='ident'>v</span> <span class='op'>==</span> <span class='ident'>b</span>); |
| 1429 |
</pre> |
| 1430 |
</div><h4 id='method.position_elem' class='method'><code>fn <a href='#method.position_elem' class='fnname'>position_elem</a>(&self, t: &T) -> <a class='enum' href='../../core/option/enum.Option.html' title='core::option::Option'>Option</a><<a href='../../core/primitive.usize.html'>usize</a>> <span class='where'>where T: <a class='trait' href='../../core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a></span></code></h4> |
| 1431 |
<div class='stability'><em class='stab unstable'>Unstable</em></div><div class='docblock'><p>Find the first index containing a matching value.</p> |
| 1432 |
</div><h4 id='method.rposition_elem' class='method'><code>fn <a href='#method.rposition_elem' class='fnname'>rposition_elem</a>(&self, t: &T) -> <a class='enum' href='../../core/option/enum.Option.html' title='core::option::Option'>Option</a><<a href='../../core/primitive.usize.html'>usize</a>> <span class='where'>where T: <a class='trait' href='../../core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a></span></code></h4> |
| 1433 |
<div class='stability'><em class='stab unstable'>Unstable</em></div><div class='docblock'><p>Find the last index containing a matching value.</p> |
| 1434 |
</div><h4 id='method.contains' class='method'><code>fn <a href='#method.contains' class='fnname'>contains</a>(&self, x: &T) -> <a href='../../core/primitive.bool.html'>bool</a> <span class='where'>where T: <a class='trait' href='../../core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a></span></code></h4> |
| 1435 |
<div class='docblock'><p>Returns true if the slice contains an element with the given value.</p> |
| 1436 |
|
| 1437 |
<h1 id="examples" class='section-header'><a |
| 1438 |
href="#examples">Examples</a></h1><span class='rusttest'>fn main() { |
| 1439 |
let v = [10, 40, 30]; |
| 1440 |
assert!(v.contains(&30)); |
| 1441 |
assert!(!v.contains(&50)); |
| 1442 |
|
| 1443 |
}</span><pre id='rust-example-rendered' class='rust '> |
| 1444 |
<span class='kw'>let</span> <span class='ident'>v</span> <span class='op'>=</span> [<span class='number'>10</span>, <span class='number'>40</span>, <span class='number'>30</span>]; |
| 1445 |
<span class='macro'>assert</span><span class='macro'>!</span>(<span class='ident'>v</span>.<span class='ident'>contains</span>(<span class='kw-2'>&</span><span class='number'>30</span>)); |
| 1446 |
<span class='macro'>assert</span><span class='macro'>!</span>(<span class='op'>!</span><span class='ident'>v</span>.<span class='ident'>contains</span>(<span class='kw-2'>&</span><span class='number'>50</span>)); |
| 1447 |
</pre> |
| 1448 |
</div><h4 id='method.starts_with' class='method'><code>fn <a href='#method.starts_with' class='fnname'>starts_with</a>(&self, needle: <a href='../primitive.slice.html'>&[T]</a>) -> <a href='../../core/primitive.bool.html'>bool</a> <span class='where'>where T: <a class='trait' href='../../core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a></span></code></h4> |
| 1449 |
<div class='docblock'><p>Returns true if <code>needle</code> is a prefix of the slice.</p> |
| 1450 |
|
| 1451 |
<h1 id="examples" class='section-header'><a |
| 1452 |
href="#examples">Examples</a></h1><span class='rusttest'>fn main() { |
| 1453 |
let v = [10, 40, 30]; |
| 1454 |
assert!(v.starts_with(&[10])); |
| 1455 |
assert!(v.starts_with(&[10, 40])); |
| 1456 |
assert!(!v.starts_with(&[50])); |
| 1457 |
assert!(!v.starts_with(&[10, 50])); |
| 1458 |
|
| 1459 |
}</span><pre id='rust-example-rendered' class='rust '> |
| 1460 |
<span class='kw'>let</span> <span class='ident'>v</span> <span class='op'>=</span> [<span class='number'>10</span>, <span class='number'>40</span>, <span class='number'>30</span>]; |
| 1461 |
<span class='macro'>assert</span><span class='macro'>!</span>(<span class='ident'>v</span>.<span class='ident'>starts_with</span>(<span class='kw-2'>&</span>[<span class='number'>10</span>])); |
| 1462 |
<span class='macro'>assert</span><span class='macro'>!</span>(<span class='ident'>v</span>.<span class='ident'>starts_with</span>(<span class='kw-2'>&</span>[<span class='number'>10</span>, <span class='number'>40</span>])); |
| 1463 |
<span class='macro'>assert</span><span class='macro'>!</span>(<span class='op'>!</span><span class='ident'>v</span>.<span class='ident'>starts_with</span>(<span class='kw-2'>&</span>[<span class='number'>50</span>])); |
| 1464 |
<span class='macro'>assert</span><span class='macro'>!</span>(<span class='op'>!</span><span class='ident'>v</span>.<span class='ident'>starts_with</span>(<span class='kw-2'>&</span>[<span class='number'>10</span>, <span class='number'>50</span>])); |
| 1465 |
</pre> |
| 1466 |
</div><h4 id='method.ends_with' class='method'><code>fn <a href='#method.ends_with' class='fnname'>ends_with</a>(&self, needle: <a href='../primitive.slice.html'>&[T]</a>) -> <a href='../../core/primitive.bool.html'>bool</a> <span class='where'>where T: <a class='trait' href='../../core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a></span></code></h4> |
| 1467 |
<div class='docblock'><p>Returns true if <code>needle</code> is a suffix of the slice.</p> |
| 1468 |
|
| 1469 |
<h1 id="examples" class='section-header'><a |
| 1470 |
href="#examples">Examples</a></h1><span class='rusttest'>fn main() { |
| 1471 |
let v = [10, 40, 30]; |
| 1472 |
assert!(v.ends_with(&[30])); |
| 1473 |
assert!(v.ends_with(&[40, 30])); |
| 1474 |
assert!(!v.ends_with(&[50])); |
| 1475 |
assert!(!v.ends_with(&[50, 30])); |
| 1476 |
|
| 1477 |
}</span><pre id='rust-example-rendered' class='rust '> |
| 1478 |
<span class='kw'>let</span> <span class='ident'>v</span> <span class='op'>=</span> [<span class='number'>10</span>, <span class='number'>40</span>, <span class='number'>30</span>]; |
| 1479 |
<span class='macro'>assert</span><span class='macro'>!</span>(<span class='ident'>v</span>.<span class='ident'>ends_with</span>(<span class='kw-2'>&</span>[<span class='number'>30</span>])); |
| 1480 |
<span class='macro'>assert</span><span class='macro'>!</span>(<span class='ident'>v</span>.<span class='ident'>ends_with</span>(<span class='kw-2'>&</span>[<span class='number'>40</span>, <span class='number'>30</span>])); |
| 1481 |
<span class='macro'>assert</span><span class='macro'>!</span>(<span class='op'>!</span><span class='ident'>v</span>.<span class='ident'>ends_with</span>(<span class='kw-2'>&</span>[<span class='number'>50</span>])); |
| 1482 |
<span class='macro'>assert</span><span class='macro'>!</span>(<span class='op'>!</span><span class='ident'>v</span>.<span class='ident'>ends_with</span>(<span class='kw-2'>&</span>[<span class='number'>50</span>, <span class='number'>30</span>])); |
| 1483 |
</pre> |
| 1484 |
</div><h4 id='method.into_vec' class='method'><code>fn <a href='#method.into_vec' class='fnname'>into_vec</a>(self: <a class='struct' href='../../collections/boxed/struct.Box.html' title='collections::boxed::Box'>Box</a><Self>) -> <a class='struct' href='../../collections/vec/struct.Vec.html' title='collections::vec::Vec'>Vec</a><T></code></h4> |
| 1485 |
<div class='docblock'><p>Converts <code>self</code> into a vector without clones or allocation.</p> |
| 1486 |
</div></div><h2 id='implementations'>Trait Implementations</h2><h3 class='impl'><code>impl<T> <a class='trait' href='../../collections/borrow/trait.Borrow.html' title='collections::borrow::Borrow'>Borrow</a><<a href='../primitive.slice.html'>[T]</a>> for <a class='struct' href='../../collections/vec/struct.Vec.html' title='collections::vec::Vec'>Vec</a><T></code></h3><div class='impl-items'><h4 id='method.borrow' class='method'><code>fn <a href='../../collections/borrow/trait.Borrow.html#method.borrow' class='fnname'>borrow</a>(&self) -> <a href='../primitive.slice.html'>&[T]</a></code></h4> |
| 1487 |
</div><h3 class='impl'><code>impl<T> <a class='trait' href='../../collections/borrow/trait.BorrowMut.html' title='collections::borrow::BorrowMut'>BorrowMut</a><<a href='../primitive.slice.html'>[T]</a>> for <a class='struct' href='../../collections/vec/struct.Vec.html' title='collections::vec::Vec'>Vec</a><T></code></h3><div class='impl-items'><h4 id='method.borrow_mut' class='method'><code>fn <a href='../../collections/borrow/trait.BorrowMut.html#method.borrow_mut' class='fnname'>borrow_mut</a>(&mut self) -> <a href='../primitive.slice.html'>&mut [T]</a></code></h4> |
| 1488 |
</div><h3 class='impl'><code>impl<T: <a class='trait' href='../../core/marker/trait.Send.html' title='core::marker::Send'>Send</a>> <a class='trait' href='../../core/marker/trait.Send.html' title='core::marker::Send'>Send</a> for <a class='struct' href='../../collections/vec/struct.Vec.html' title='collections::vec::Vec'>Vec</a><T></code></h3><div class='impl-items'></div><h3 class='impl'><code>impl<T: <a class='trait' href='../../core/marker/trait.Sync.html' title='core::marker::Sync'>Sync</a>> <a class='trait' href='../../core/marker/trait.Sync.html' title='core::marker::Sync'>Sync</a> for <a class='struct' href='../../collections/vec/struct.Vec.html' title='collections::vec::Vec'>Vec</a><T></code></h3><div class='impl-items'></div><h3 class='impl'><code>impl<T: <a class='trait' href='../../core/clone/trait.Clone.html' title='core::clone::Clone'>Clone</a>> <a class='trait' href='../../core/clone/trait.Clone.html' title='core::clone::Clone'>Clone</a> for <a class='struct' href='../../collections/vec/struct.Vec.html' title='collections::vec::Vec'>Vec</a><T></code></h3><div class='impl-items'><h4 id='method.clone' class='method'><code>fn <a href='../../core/clone/trait.Clone.html#method.clone' class='fnname'>clone</a>(&self) -> <a class='struct' href='../../collections/vec/struct.Vec.html' title='collections::vec::Vec'>Vec</a><T></code></h4> |
| 1489 |
<h4 id='method.clone_from' class='method'><code>fn <a href='../../core/clone/trait.Clone.html#method.clone_from' class='fnname'>clone_from</a>(&mut self, other: &<a class='struct' href='../../collections/vec/struct.Vec.html' title='collections::vec::Vec'>Vec</a><T>)</code></h4> |
| 1490 |
</div><h3 class='impl'><code>impl<T: <a class='trait' href='../../core/hash/trait.Hash.html' title='core::hash::Hash'>Hash</a>> <a class='trait' href='../../core/hash/trait.Hash.html' title='core::hash::Hash'>Hash</a> for <a class='struct' href='../../collections/vec/struct.Vec.html' title='collections::vec::Vec'>Vec</a><T></code></h3><div class='impl-items'><h4 id='method.hash' class='method'><code>fn <a href='../../core/hash/trait.Hash.html#method.hash' class='fnname'>hash</a><H: <a class='trait' href='../../core/hash/trait.Hasher.html' title='core::hash::Hasher'>Hasher</a>>(&self, state: &mut H)</code></h4> |
| 1491 |
<h4 id='method.hash_slice' class='method'><code>fn <a href='../../core/hash/trait.Hash.html#method.hash_slice' class='fnname'>hash_slice</a><H>(data: <a href='../primitive.slice.html'>&[Self]</a>, state: &mut H) <span class='where'>where H: <a class='trait' href='../../core/hash/trait.Hasher.html' title='core::hash::Hasher'>Hasher</a></span></code></h4> |
| 1492 |
</div><h3 class='impl'><code>impl<T> <a class='trait' href='../../core/ops/trait.Index.html' title='core::ops::Index'>Index</a><<a href='../../core/primitive.usize.html'>usize</a>> for <a class='struct' href='../../collections/vec/struct.Vec.html' title='collections::vec::Vec'>Vec</a><T></code></h3><div class='impl-items'><h4 id='assoc_type.Output' class='type'><code>type Output = T</code></h4> |
| 1493 |
<h4 id='method.index' class='method'><code>fn <a href='../../core/ops/trait.Index.html#method.index' class='fnname'>index</a>(&self, index: <a href='../../core/primitive.usize.html'>usize</a>) -> &T</code></h4> |
| 1494 |
</div><h3 class='impl'><code>impl<T> <a class='trait' href='../../core/ops/trait.IndexMut.html' title='core::ops::IndexMut'>IndexMut</a><<a href='../../core/primitive.usize.html'>usize</a>> for <a class='struct' href='../../collections/vec/struct.Vec.html' title='collections::vec::Vec'>Vec</a><T></code></h3><div class='impl-items'><h4 id='method.index_mut' class='method'><code>fn <a href='../../core/ops/trait.IndexMut.html#method.index_mut' class='fnname'>index_mut</a>(&mut self, index: <a href='../../core/primitive.usize.html'>usize</a>) -> &mut T</code></h4> |
| 1495 |
</div><h3 class='impl'><code>impl<T> <a class='trait' href='../../core/ops/trait.Index.html' title='core::ops::Index'>Index</a><<a class='struct' href='../../core/ops/struct.Range.html' title='core::ops::Range'>Range</a><<a href='../../core/primitive.usize.html'>usize</a>>> for <a class='struct' href='../../collections/vec/struct.Vec.html' title='collections::vec::Vec'>Vec</a><T></code></h3><div class='impl-items'><h4 id='assoc_type.Output' class='type'><code>type Output = <a href='../primitive.slice.html'>[T]</a></code></h4> |
| 1496 |
<h4 id='method.index' class='method'><code>fn <a href='../../core/ops/trait.Index.html#method.index' class='fnname'>index</a>(&self, index: <a class='struct' href='../../core/ops/struct.Range.html' title='core::ops::Range'>Range</a><<a href='../../core/primitive.usize.html'>usize</a>>) -> <a href='../primitive.slice.html'>&[T]</a></code></h4> |
| 1497 |
</div><h3 class='impl'><code>impl<T> <a class='trait' href='../../core/ops/trait.Index.html' title='core::ops::Index'>Index</a><<a class='struct' href='../../core/ops/struct.RangeTo.html' title='core::ops::RangeTo'>RangeTo</a><<a href='../../core/primitive.usize.html'>usize</a>>> for <a class='struct' href='../../collections/vec/struct.Vec.html' title='collections::vec::Vec'>Vec</a><T></code></h3><div class='impl-items'><h4 id='assoc_type.Output' class='type'><code>type Output = <a href='../primitive.slice.html'>[T]</a></code></h4> |
| 1498 |
<h4 id='method.index' class='method'><code>fn <a href='../../core/ops/trait.Index.html#method.index' class='fnname'>index</a>(&self, index: <a class='struct' href='../../core/ops/struct.RangeTo.html' title='core::ops::RangeTo'>RangeTo</a><<a href='../../core/primitive.usize.html'>usize</a>>) -> <a href='../primitive.slice.html'>&[T]</a></code></h4> |
| 1499 |
</div><h3 class='impl'><code>impl<T> <a class='trait' href='../../core/ops/trait.Index.html' title='core::ops::Index'>Index</a><<a class='struct' href='../../core/ops/struct.RangeFrom.html' title='core::ops::RangeFrom'>RangeFrom</a><<a href='../../core/primitive.usize.html'>usize</a>>> for <a class='struct' href='../../collections/vec/struct.Vec.html' title='collections::vec::Vec'>Vec</a><T></code></h3><div class='impl-items'><h4 id='assoc_type.Output' class='type'><code>type Output = <a href='../primitive.slice.html'>[T]</a></code></h4> |
| 1500 |
<h4 id='method.index' class='method'><code>fn <a href='../../core/ops/trait.Index.html#method.index' class='fnname'>index</a>(&self, index: <a class='struct' href='../../core/ops/struct.RangeFrom.html' title='core::ops::RangeFrom'>RangeFrom</a><<a href='../../core/primitive.usize.html'>usize</a>>) -> <a href='../primitive.slice.html'>&[T]</a></code></h4> |
| 1501 |
</div><h3 class='impl'><code>impl<T> <a class='trait' href='../../core/ops/trait.Index.html' title='core::ops::Index'>Index</a><<a class='struct' href='../../core/ops/struct.RangeFull.html' title='core::ops::RangeFull'>RangeFull</a>> for <a class='struct' href='../../collections/vec/struct.Vec.html' title='collections::vec::Vec'>Vec</a><T></code></h3><div class='impl-items'><h4 id='assoc_type.Output' class='type'><code>type Output = <a href='../primitive.slice.html'>[T]</a></code></h4> |
| 1502 |
<h4 id='method.index' class='method'><code>fn <a href='../../core/ops/trait.Index.html#method.index' class='fnname'>index</a>(&self, _index: <a class='struct' href='../../core/ops/struct.RangeFull.html' title='core::ops::RangeFull'>RangeFull</a>) -> <a href='../primitive.slice.html'>&[T]</a></code></h4> |
| 1503 |
</div><h3 class='impl'><code>impl<T> <a class='trait' href='../../core/ops/trait.IndexMut.html' title='core::ops::IndexMut'>IndexMut</a><<a class='struct' href='../../core/ops/struct.Range.html' title='core::ops::Range'>Range</a><<a href='../../core/primitive.usize.html'>usize</a>>> for <a class='struct' href='../../collections/vec/struct.Vec.html' title='collections::vec::Vec'>Vec</a><T></code></h3><div class='impl-items'><h4 id='method.index_mut' class='method'><code>fn <a href='../../core/ops/trait.IndexMut.html#method.index_mut' class='fnname'>index_mut</a>(&mut self, index: <a class='struct' href='../../core/ops/struct.Range.html' title='core::ops::Range'>Range</a><<a href='../../core/primitive.usize.html'>usize</a>>) -> <a href='../primitive.slice.html'>&mut [T]</a></code></h4> |
| 1504 |
</div><h3 class='impl'><code>impl<T> <a class='trait' href='../../core/ops/trait.IndexMut.html' title='core::ops::IndexMut'>IndexMut</a><<a class='struct' href='../../core/ops/struct.RangeTo.html' title='core::ops::RangeTo'>RangeTo</a><<a href='../../core/primitive.usize.html'>usize</a>>> for <a class='struct' href='../../collections/vec/struct.Vec.html' title='collections::vec::Vec'>Vec</a><T></code></h3><div class='impl-items'><h4 id='method.index_mut' class='method'><code>fn <a href='../../core/ops/trait.IndexMut.html#method.index_mut' class='fnname'>index_mut</a>(&mut self, index: <a class='struct' href='../../core/ops/struct.RangeTo.html' title='core::ops::RangeTo'>RangeTo</a><<a href='../../core/primitive.usize.html'>usize</a>>) -> <a href='../primitive.slice.html'>&mut [T]</a></code></h4> |
| 1505 |
</div><h3 class='impl'><code>impl<T> <a class='trait' href='../../core/ops/trait.IndexMut.html' title='core::ops::IndexMut'>IndexMut</a><<a class='struct' href='../../core/ops/struct.RangeFrom.html' title='core::ops::RangeFrom'>RangeFrom</a><<a href='../../core/primitive.usize.html'>usize</a>>> for <a class='struct' href='../../collections/vec/struct.Vec.html' title='collections::vec::Vec'>Vec</a><T></code></h3><div class='impl-items'><h4 id='method.index_mut' class='method'><code>fn <a href='../../core/ops/trait.IndexMut.html#method.index_mut' class='fnname'>index_mut</a>(&mut self, index: <a class='struct' href='../../core/ops/struct.RangeFrom.html' title='core::ops::RangeFrom'>RangeFrom</a><<a href='../../core/primitive.usize.html'>usize</a>>) -> <a href='../primitive.slice.html'>&mut [T]</a></code></h4> |
| 1506 |
</div><h3 class='impl'><code>impl<T> <a class='trait' href='../../core/ops/trait.IndexMut.html' title='core::ops::IndexMut'>IndexMut</a><<a class='struct' href='../../core/ops/struct.RangeFull.html' title='core::ops::RangeFull'>RangeFull</a>> for <a class='struct' href='../../collections/vec/struct.Vec.html' title='collections::vec::Vec'>Vec</a><T></code></h3><div class='impl-items'><h4 id='method.index_mut' class='method'><code>fn <a href='../../core/ops/trait.IndexMut.html#method.index_mut' class='fnname'>index_mut</a>(&mut self, _index: <a class='struct' href='../../core/ops/struct.RangeFull.html' title='core::ops::RangeFull'>RangeFull</a>) -> <a href='../primitive.slice.html'>&mut [T]</a></code></h4> |
| 1507 |
</div><h3 class='impl'><code>impl<T> <a class='trait' href='../../core/ops/trait.Deref.html' title='core::ops::Deref'>Deref</a> for <a class='struct' href='../../collections/vec/struct.Vec.html' title='collections::vec::Vec'>Vec</a><T></code></h3><div class='impl-items'><h4 id='assoc_type.Target' class='type'><code>type Target = <a href='../primitive.slice.html'>[T]</a></code></h4> |
| 1508 |
<h4 id='method.deref' class='method'><code>fn <a href='../../core/ops/trait.Deref.html#method.deref' class='fnname'>deref</a>(&self) -> <a href='../primitive.slice.html'>&[T]</a></code></h4> |
| 1509 |
</div><h3 class='impl'><code>impl<T> <a class='trait' href='../../core/ops/trait.DerefMut.html' title='core::ops::DerefMut'>DerefMut</a> for <a class='struct' href='../../collections/vec/struct.Vec.html' title='collections::vec::Vec'>Vec</a><T></code></h3><div class='impl-items'><h4 id='method.deref_mut' class='method'><code>fn <a href='../../core/ops/trait.DerefMut.html#method.deref_mut' class='fnname'>deref_mut</a>(&mut self) -> <a href='../primitive.slice.html'>&mut [T]</a></code></h4> |
| 1510 |
</div><h3 class='impl'><code>impl<T> <a class='trait' href='../../core/iter/trait.FromIterator.html' title='core::iter::FromIterator'>FromIterator</a><T> for <a class='struct' href='../../collections/vec/struct.Vec.html' title='collections::vec::Vec'>Vec</a><T></code></h3><div class='impl-items'><h4 id='method.from_iter' class='method'><code>fn <a href='../../core/iter/trait.FromIterator.html#method.from_iter' class='fnname'>from_iter</a><I: <a class='trait' href='../../core/iter/trait.IntoIterator.html' title='core::iter::IntoIterator'>IntoIterator</a><Item=T>>(iterable: I) -> <a class='struct' href='../../collections/vec/struct.Vec.html' title='collections::vec::Vec'>Vec</a><T></code></h4> |
| 1511 |
</div><h3 class='impl'><code>impl<T> <a class='trait' href='../../core/iter/trait.IntoIterator.html' title='core::iter::IntoIterator'>IntoIterator</a> for <a class='struct' href='../../collections/vec/struct.Vec.html' title='collections::vec::Vec'>Vec</a><T></code></h3><div class='impl-items'><h4 id='assoc_type.Item' class='type'><code>type Item = T</code></h4> |
| 1512 |
<h4 id='assoc_type.IntoIter' class='type'><code>type IntoIter = <a class='struct' href='../../collections/vec/struct.IntoIter.html' title='collections::vec::IntoIter'>IntoIter</a><T></code></h4> |
| 1513 |
<h4 id='method.into_iter' class='method'><code>fn <a href='../../core/iter/trait.IntoIterator.html#method.into_iter' class='fnname'>into_iter</a>(self) -> <a class='struct' href='../../collections/vec/struct.IntoIter.html' title='collections::vec::IntoIter'>IntoIter</a><T></code></h4> |
| 1514 |
</div><h3 class='impl'><code>impl<'a, T> <a class='trait' href='../../core/iter/trait.IntoIterator.html' title='core::iter::IntoIterator'>IntoIterator</a> for &'a <a class='struct' href='../../collections/vec/struct.Vec.html' title='collections::vec::Vec'>Vec</a><T></code></h3><div class='impl-items'><h4 id='assoc_type.Item' class='type'><code>type Item = &'a T</code></h4> |
| 1515 |
<h4 id='assoc_type.IntoIter' class='type'><code>type IntoIter = <a class='struct' href='../../collections/slice/struct.Iter.html' title='collections::slice::Iter'>Iter</a><'a, T></code></h4> |
| 1516 |
<h4 id='method.into_iter' class='method'><code>fn <a href='../../core/iter/trait.IntoIterator.html#method.into_iter' class='fnname'>into_iter</a>(self) -> <a class='struct' href='../../collections/slice/struct.Iter.html' title='collections::slice::Iter'>Iter</a><'a, T></code></h4> |
| 1517 |
</div><h3 class='impl'><code>impl<'a, T> <a class='trait' href='../../core/iter/trait.IntoIterator.html' title='core::iter::IntoIterator'>IntoIterator</a> for &'a mut <a class='struct' href='../../collections/vec/struct.Vec.html' title='collections::vec::Vec'>Vec</a><T></code></h3><div class='impl-items'><h4 id='assoc_type.Item' class='type'><code>type Item = &'a mut T</code></h4> |
| 1518 |
<h4 id='assoc_type.IntoIter' class='type'><code>type IntoIter = <a class='struct' href='../../collections/slice/struct.IterMut.html' title='collections::slice::IterMut'>IterMut</a><'a, T></code></h4> |
| 1519 |
<h4 id='method.into_iter' class='method'><code>fn <a href='../../core/iter/trait.IntoIterator.html#method.into_iter' class='fnname'>into_iter</a>(self) -> <a class='struct' href='../../collections/slice/struct.IterMut.html' title='collections::slice::IterMut'>IterMut</a><'a, T></code></h4> |
| 1520 |
</div><h3 class='impl'><code>impl<T> <a class='trait' href='../../core/iter/trait.Extend.html' title='core::iter::Extend'>Extend</a><T> for <a class='struct' href='../../collections/vec/struct.Vec.html' title='collections::vec::Vec'>Vec</a><T></code></h3><div class='impl-items'><h4 id='method.extend' class='method'><code>fn <a href='../../core/iter/trait.Extend.html#method.extend' class='fnname'>extend</a><I: <a class='trait' href='../../core/iter/trait.IntoIterator.html' title='core::iter::IntoIterator'>IntoIterator</a><Item=T>>(&mut self, iterable: I)</code></h4> |
| 1521 |
</div><h3 class='impl'><code>impl<'a, 'b, A: <a class='trait' href='../../core/marker/trait.Sized.html' title='core::marker::Sized'>Sized</a>, B> <a class='trait' href='../../core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a><<a class='struct' href='../../collections/vec/struct.Vec.html' title='collections::vec::Vec'>Vec</a><B>> for <a class='struct' href='../../collections/vec/struct.Vec.html' title='collections::vec::Vec'>Vec</a><A> <span class='where'>where A: <a class='trait' href='../../core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a><B></span></code></h3><div class='impl-items'><h4 id='method.eq' class='method'><code>fn <a href='../../core/cmp/trait.PartialEq.html#method.eq' class='fnname'>eq</a>(&self, other: &<a class='struct' href='../../collections/vec/struct.Vec.html' title='collections::vec::Vec'>Vec</a><B>) -> <a href='../../core/primitive.bool.html'>bool</a></code></h4> |
| 1522 |
<h4 id='method.ne' class='method'><code>fn <a href='../../core/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&self, other: &<a class='struct' href='../../collections/vec/struct.Vec.html' title='collections::vec::Vec'>Vec</a><B>) -> <a href='../../core/primitive.bool.html'>bool</a></code></h4> |
| 1523 |
</div><h3 class='impl'><code>impl<'a, 'b, A: <a class='trait' href='../../core/marker/trait.Sized.html' title='core::marker::Sized'>Sized</a>, B> <a class='trait' href='../../core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a><<a href='../primitive.slice.html'>&'b [B]</a>> for <a class='struct' href='../../collections/vec/struct.Vec.html' title='collections::vec::Vec'>Vec</a><A> <span class='where'>where A: <a class='trait' href='../../core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a><B></span></code></h3><div class='impl-items'><h4 id='method.eq' class='method'><code>fn <a href='../../core/cmp/trait.PartialEq.html#method.eq' class='fnname'>eq</a>(&self, other: &<a href='../primitive.slice.html'>&'b [B]</a>) -> <a href='../../core/primitive.bool.html'>bool</a></code></h4> |
| 1524 |
<h4 id='method.ne' class='method'><code>fn <a href='../../core/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&self, other: &<a href='../primitive.slice.html'>&'b [B]</a>) -> <a href='../../core/primitive.bool.html'>bool</a></code></h4> |
| 1525 |
</div><h3 class='impl'><code>impl<'a, 'b, A: <a class='trait' href='../../core/marker/trait.Sized.html' title='core::marker::Sized'>Sized</a>, B> <a class='trait' href='../../core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a><<a href='../primitive.slice.html'>&'b mut [B]</a>> for <a class='struct' href='../../collections/vec/struct.Vec.html' title='collections::vec::Vec'>Vec</a><A> <span class='where'>where A: <a class='trait' href='../../core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a><B></span></code></h3><div class='impl-items'><h4 id='method.eq' class='method'><code>fn <a href='../../core/cmp/trait.PartialEq.html#method.eq' class='fnname'>eq</a>(&self, other: &<a href='../primitive.slice.html'>&'b mut [B]</a>) -> <a href='../../core/primitive.bool.html'>bool</a></code></h4> |
| 1526 |
<h4 id='method.ne' class='method'><code>fn <a href='../../core/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&self, other: &<a href='../primitive.slice.html'>&'b mut [B]</a>) -> <a href='../../core/primitive.bool.html'>bool</a></code></h4> |
| 1527 |
</div><h3 class='impl'><code>impl<'a, 'b, A: <a class='trait' href='../../core/marker/trait.Sized.html' title='core::marker::Sized'>Sized</a>, B> <a class='trait' href='../../core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a><<a href='../../core/primitive.array.html'>[B; 0]</a>> for <a class='struct' href='../../collections/vec/struct.Vec.html' title='collections::vec::Vec'>Vec</a><A> <span class='where'>where A: <a class='trait' href='../../core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a><B></span></code></h3><div class='impl-items'><h4 id='method.eq' class='method'><code>fn <a href='../../core/cmp/trait.PartialEq.html#method.eq' class='fnname'>eq</a>(&self, other: &<a href='../../core/primitive.array.html'>[B; 0]</a>) -> <a href='../../core/primitive.bool.html'>bool</a></code></h4> |
| 1528 |
<h4 id='method.ne' class='method'><code>fn <a href='../../core/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&self, other: &<a href='../../core/primitive.array.html'>[B; 0]</a>) -> <a href='../../core/primitive.bool.html'>bool</a></code></h4> |
| 1529 |
</div><h3 class='impl'><code>impl<'a, 'b, A: <a class='trait' href='../../core/marker/trait.Sized.html' title='core::marker::Sized'>Sized</a>, B> <a class='trait' href='../../core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a><&'b <a href='../../core/primitive.array.html'>[B; 0]</a>> for <a class='struct' href='../../collections/vec/struct.Vec.html' title='collections::vec::Vec'>Vec</a><A> <span class='where'>where A: <a class='trait' href='../../core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a><B></span></code></h3><div class='impl-items'><h4 id='method.eq' class='method'><code>fn <a href='../../core/cmp/trait.PartialEq.html#method.eq' class='fnname'>eq</a>(&self, other: &&'b <a href='../../core/primitive.array.html'>[B; 0]</a>) -> <a href='../../core/primitive.bool.html'>bool</a></code></h4> |
| 1530 |
<h4 id='method.ne' class='method'><code>fn <a href='../../core/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&self, other: &&'b <a href='../../core/primitive.array.html'>[B; 0]</a>) -> <a href='../../core/primitive.bool.html'>bool</a></code></h4> |
| 1531 |
</div><h3 class='impl'><code>impl<'a, 'b, A: <a class='trait' href='../../core/marker/trait.Sized.html' title='core::marker::Sized'>Sized</a>, B> <a class='trait' href='../../core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a><<a href='../../core/primitive.array.html'>[B; 1]</a>> for <a class='struct' href='../../collections/vec/struct.Vec.html' title='collections::vec::Vec'>Vec</a><A> <span class='where'>where A: <a class='trait' href='../../core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a><B></span></code></h3><div class='impl-items'><h4 id='method.eq' class='method'><code>fn <a href='../../core/cmp/trait.PartialEq.html#method.eq' class='fnname'>eq</a>(&self, other: &<a href='../../core/primitive.array.html'>[B; 1]</a>) -> <a href='../../core/primitive.bool.html'>bool</a></code></h4> |
| 1532 |
<h4 id='method.ne' class='method'><code>fn <a href='../../core/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&self, other: &<a href='../../core/primitive.array.html'>[B; 1]</a>) -> <a href='../../core/primitive.bool.html'>bool</a></code></h4> |
| 1533 |
</div><h3 class='impl'><code>impl<'a, 'b, A: <a class='trait' href='../../core/marker/trait.Sized.html' title='core::marker::Sized'>Sized</a>, B> <a class='trait' href='../../core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a><&'b <a href='../../core/primitive.array.html'>[B; 1]</a>> for <a class='struct' href='../../collections/vec/struct.Vec.html' title='collections::vec::Vec'>Vec</a><A> <span class='where'>where A: <a class='trait' href='../../core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a><B></span></code></h3><div class='impl-items'><h4 id='method.eq' class='method'><code>fn <a href='../../core/cmp/trait.PartialEq.html#method.eq' class='fnname'>eq</a>(&self, other: &&'b <a href='../../core/primitive.array.html'>[B; 1]</a>) -> <a href='../../core/primitive.bool.html'>bool</a></code></h4> |
| 1534 |
<h4 id='method.ne' class='method'><code>fn <a href='../../core/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&self, other: &&'b <a href='../../core/primitive.array.html'>[B; 1]</a>) -> <a href='../../core/primitive.bool.html'>bool</a></code></h4> |
| 1535 |
</div><h3 class='impl'><code>impl<'a, 'b, A: <a class='trait' href='../../core/marker/trait.Sized.html' title='core::marker::Sized'>Sized</a>, B> <a class='trait' href='../../core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a><<a href='../../core/primitive.array.html'>[B; 2]</a>> for <a class='struct' href='../../collections/vec/struct.Vec.html' title='collections::vec::Vec'>Vec</a><A> <span class='where'>where A: <a class='trait' href='../../core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a><B></span></code></h3><div class='impl-items'><h4 id='method.eq' class='method'><code>fn <a href='../../core/cmp/trait.PartialEq.html#method.eq' class='fnname'>eq</a>(&self, other: &<a href='../../core/primitive.array.html'>[B; 2]</a>) -> <a href='../../core/primitive.bool.html'>bool</a></code></h4> |
| 1536 |
<h4 id='method.ne' class='method'><code>fn <a href='../../core/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&self, other: &<a href='../../core/primitive.array.html'>[B; 2]</a>) -> <a href='../../core/primitive.bool.html'>bool</a></code></h4> |
| 1537 |
</div><h3 class='impl'><code>impl<'a, 'b, A: <a class='trait' href='../../core/marker/trait.Sized.html' title='core::marker::Sized'>Sized</a>, B> <a class='trait' href='../../core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a><&'b <a href='../../core/primitive.array.html'>[B; 2]</a>> for <a class='struct' href='../../collections/vec/struct.Vec.html' title='collections::vec::Vec'>Vec</a><A> <span class='where'>where A: <a class='trait' href='../../core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a><B></span></code></h3><div class='impl-items'><h4 id='method.eq' class='method'><code>fn <a href='../../core/cmp/trait.PartialEq.html#method.eq' class='fnname'>eq</a>(&self, other: &&'b <a href='../../core/primitive.array.html'>[B; 2]</a>) -> <a href='../../core/primitive.bool.html'>bool</a></code></h4> |
| 1538 |
<h4 id='method.ne' class='method'><code>fn <a href='../../core/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&self, other: &&'b <a href='../../core/primitive.array.html'>[B; 2]</a>) -> <a href='../../core/primitive.bool.html'>bool</a></code></h4> |
| 1539 |
</div><h3 class='impl'><code>impl<'a, 'b, A: <a class='trait' href='../../core/marker/trait.Sized.html' title='core::marker::Sized'>Sized</a>, B> <a class='trait' href='../../core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a><<a href='../../core/primitive.array.html'>[B; 3]</a>> for <a class='struct' href='../../collections/vec/struct.Vec.html' title='collections::vec::Vec'>Vec</a><A> <span class='where'>where A: <a class='trait' href='../../core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a><B></span></code></h3><div class='impl-items'><h4 id='method.eq' class='method'><code>fn <a href='../../core/cmp/trait.PartialEq.html#method.eq' class='fnname'>eq</a>(&self, other: &<a href='../../core/primitive.array.html'>[B; 3]</a>) -> <a href='../../core/primitive.bool.html'>bool</a></code></h4> |
| 1540 |
<h4 id='method.ne' class='method'><code>fn <a href='../../core/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&self, other: &<a href='../../core/primitive.array.html'>[B; 3]</a>) -> <a href='../../core/primitive.bool.html'>bool</a></code></h4> |
| 1541 |
</div><h3 class='impl'><code>impl<'a, 'b, A: <a class='trait' href='../../core/marker/trait.Sized.html' title='core::marker::Sized'>Sized</a>, B> <a class='trait' href='../../core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a><&'b <a href='../../core/primitive.array.html'>[B; 3]</a>> for <a class='struct' href='../../collections/vec/struct.Vec.html' title='collections::vec::Vec'>Vec</a><A> <span class='where'>where A: <a class='trait' href='../../core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a><B></span></code></h3><div class='impl-items'><h4 id='method.eq' class='method'><code>fn <a href='../../core/cmp/trait.PartialEq.html#method.eq' class='fnname'>eq</a>(&self, other: &&'b <a href='../../core/primitive.array.html'>[B; 3]</a>) -> <a href='../../core/primitive.bool.html'>bool</a></code></h4> |
| 1542 |
<h4 id='method.ne' class='method'><code>fn <a href='../../core/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&self, other: &&'b <a href='../../core/primitive.array.html'>[B; 3]</a>) -> <a href='../../core/primitive.bool.html'>bool</a></code></h4> |
| 1543 |
</div><h3 class='impl'><code>impl<'a, 'b, A: <a class='trait' href='../../core/marker/trait.Sized.html' title='core::marker::Sized'>Sized</a>, B> <a class='trait' href='../../core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a><<a href='../../core/primitive.array.html'>[B; 4]</a>> for <a class='struct' href='../../collections/vec/struct.Vec.html' title='collections::vec::Vec'>Vec</a><A> <span class='where'>where A: <a class='trait' href='../../core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a><B></span></code></h3><div class='impl-items'><h4 id='method.eq' class='method'><code>fn <a href='../../core/cmp/trait.PartialEq.html#method.eq' class='fnname'>eq</a>(&self, other: &<a href='../../core/primitive.array.html'>[B; 4]</a>) -> <a href='../../core/primitive.bool.html'>bool</a></code></h4> |
| 1544 |
<h4 id='method.ne' class='method'><code>fn <a href='../../core/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&self, other: &<a href='../../core/primitive.array.html'>[B; 4]</a>) -> <a href='../../core/primitive.bool.html'>bool</a></code></h4> |
| 1545 |
</div><h3 class='impl'><code>impl<'a, 'b, A: <a class='trait' href='../../core/marker/trait.Sized.html' title='core::marker::Sized'>Sized</a>, B> <a class='trait' href='../../core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a><&'b <a href='../../core/primitive.array.html'>[B; 4]</a>> for <a class='struct' href='../../collections/vec/struct.Vec.html' title='collections::vec::Vec'>Vec</a><A> <span class='where'>where A: <a class='trait' href='../../core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a><B></span></code></h3><div class='impl-items'><h4 id='method.eq' class='method'><code>fn <a href='../../core/cmp/trait.PartialEq.html#method.eq' class='fnname'>eq</a>(&self, other: &&'b <a href='../../core/primitive.array.html'>[B; 4]</a>) -> <a href='../../core/primitive.bool.html'>bool</a></code></h4> |
| 1546 |
<h4 id='method.ne' class='method'><code>fn <a href='../../core/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&self, other: &&'b <a href='../../core/primitive.array.html'>[B; 4]</a>) -> <a href='../../core/primitive.bool.html'>bool</a></code></h4> |
| 1547 |
</div><h3 class='impl'><code>impl<'a, 'b, A: <a class='trait' href='../../core/marker/trait.Sized.html' title='core::marker::Sized'>Sized</a>, B> <a class='trait' href='../../core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a><<a href='../../core/primitive.array.html'>[B; 5]</a>> for <a class='struct' href='../../collections/vec/struct.Vec.html' title='collections::vec::Vec'>Vec</a><A> <span class='where'>where A: <a class='trait' href='../../core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a><B></span></code></h3><div class='impl-items'><h4 id='method.eq' class='method'><code>fn <a href='../../core/cmp/trait.PartialEq.html#method.eq' class='fnname'>eq</a>(&self, other: &<a href='../../core/primitive.array.html'>[B; 5]</a>) -> <a href='../../core/primitive.bool.html'>bool</a></code></h4> |
| 1548 |
<h4 id='method.ne' class='method'><code>fn <a href='../../core/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&self, other: &<a href='../../core/primitive.array.html'>[B; 5]</a>) -> <a href='../../core/primitive.bool.html'>bool</a></code></h4> |
| 1549 |
</div><h3 class='impl'><code>impl<'a, 'b, A: <a class='trait' href='../../core/marker/trait.Sized.html' title='core::marker::Sized'>Sized</a>, B> <a class='trait' href='../../core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a><&'b <a href='../../core/primitive.array.html'>[B; 5]</a>> for <a class='struct' href='../../collections/vec/struct.Vec.html' title='collections::vec::Vec'>Vec</a><A> <span class='where'>where A: <a class='trait' href='../../core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a><B></span></code></h3><div class='impl-items'><h4 id='method.eq' class='method'><code>fn <a href='../../core/cmp/trait.PartialEq.html#method.eq' class='fnname'>eq</a>(&self, other: &&'b <a href='../../core/primitive.array.html'>[B; 5]</a>) -> <a href='../../core/primitive.bool.html'>bool</a></code></h4> |
| 1550 |
<h4 id='method.ne' class='method'><code>fn <a href='../../core/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&self, other: &&'b <a href='../../core/primitive.array.html'>[B; 5]</a>) -> <a href='../../core/primitive.bool.html'>bool</a></code></h4> |
| 1551 |
</div><h3 class='impl'><code>impl<'a, 'b, A: <a class='trait' href='../../core/marker/trait.Sized.html' title='core::marker::Sized'>Sized</a>, B> <a class='trait' href='../../core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a><<a href='../../core/primitive.array.html'>[B; 6]</a>> for <a class='struct' href='../../collections/vec/struct.Vec.html' title='collections::vec::Vec'>Vec</a><A> <span class='where'>where A: <a class='trait' href='../../core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a><B></span></code></h3><div class='impl-items'><h4 id='method.eq' class='method'><code>fn <a href='../../core/cmp/trait.PartialEq.html#method.eq' class='fnname'>eq</a>(&self, other: &<a href='../../core/primitive.array.html'>[B; 6]</a>) -> <a href='../../core/primitive.bool.html'>bool</a></code></h4> |
| 1552 |
<h4 id='method.ne' class='method'><code>fn <a href='../../core/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&self, other: &<a href='../../core/primitive.array.html'>[B; 6]</a>) -> <a href='../../core/primitive.bool.html'>bool</a></code></h4> |
| 1553 |
</div><h3 class='impl'><code>impl<'a, 'b, A: <a class='trait' href='../../core/marker/trait.Sized.html' title='core::marker::Sized'>Sized</a>, B> <a class='trait' href='../../core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a><&'b <a href='../../core/primitive.array.html'>[B; 6]</a>> for <a class='struct' href='../../collections/vec/struct.Vec.html' title='collections::vec::Vec'>Vec</a><A> <span class='where'>where A: <a class='trait' href='../../core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a><B></span></code></h3><div class='impl-items'><h4 id='method.eq' class='method'><code>fn <a href='../../core/cmp/trait.PartialEq.html#method.eq' class='fnname'>eq</a>(&self, other: &&'b <a href='../../core/primitive.array.html'>[B; 6]</a>) -> <a href='../../core/primitive.bool.html'>bool</a></code></h4> |
| 1554 |
<h4 id='method.ne' class='method'><code>fn <a href='../../core/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&self, other: &&'b <a href='../../core/primitive.array.html'>[B; 6]</a>) -> <a href='../../core/primitive.bool.html'>bool</a></code></h4> |
| 1555 |
</div><h3 class='impl'><code>impl<'a, 'b, A: <a class='trait' href='../../core/marker/trait.Sized.html' title='core::marker::Sized'>Sized</a>, B> <a class='trait' href='../../core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a><<a href='../../core/primitive.array.html'>[B; 7]</a>> for <a class='struct' href='../../collections/vec/struct.Vec.html' title='collections::vec::Vec'>Vec</a><A> <span class='where'>where A: <a class='trait' href='../../core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a><B></span></code></h3><div class='impl-items'><h4 id='method.eq' class='method'><code>fn <a href='../../core/cmp/trait.PartialEq.html#method.eq' class='fnname'>eq</a>(&self, other: &<a href='../../core/primitive.array.html'>[B; 7]</a>) -> <a href='../../core/primitive.bool.html'>bool</a></code></h4> |
| 1556 |
<h4 id='method.ne' class='method'><code>fn <a href='../../core/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&self, other: &<a href='../../core/primitive.array.html'>[B; 7]</a>) -> <a href='../../core/primitive.bool.html'>bool</a></code></h4> |
| 1557 |
</div><h3 class='impl'><code>impl<'a, 'b, A: <a class='trait' href='../../core/marker/trait.Sized.html' title='core::marker::Sized'>Sized</a>, B> <a class='trait' href='../../core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a><&'b <a href='../../core/primitive.array.html'>[B; 7]</a>> for <a class='struct' href='../../collections/vec/struct.Vec.html' title='collections::vec::Vec'>Vec</a><A> <span class='where'>where A: <a class='trait' href='../../core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a><B></span></code></h3><div class='impl-items'><h4 id='method.eq' class='method'><code>fn <a href='../../core/cmp/trait.PartialEq.html#method.eq' class='fnname'>eq</a>(&self, other: &&'b <a href='../../core/primitive.array.html'>[B; 7]</a>) -> <a href='../../core/primitive.bool.html'>bool</a></code></h4> |
| 1558 |
<h4 id='method.ne' class='method'><code>fn <a href='../../core/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&self, other: &&'b <a href='../../core/primitive.array.html'>[B; 7]</a>) -> <a href='../../core/primitive.bool.html'>bool</a></code></h4> |
| 1559 |
</div><h3 class='impl'><code>impl<'a, 'b, A: <a class='trait' href='../../core/marker/trait.Sized.html' title='core::marker::Sized'>Sized</a>, B> <a class='trait' href='../../core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a><<a href='../../core/primitive.array.html'>[B; 8]</a>> for <a class='struct' href='../../collections/vec/struct.Vec.html' title='collections::vec::Vec'>Vec</a><A> <span class='where'>where A: <a class='trait' href='../../core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a><B></span></code></h3><div class='impl-items'><h4 id='method.eq' class='method'><code>fn <a href='../../core/cmp/trait.PartialEq.html#method.eq' class='fnname'>eq</a>(&self, other: &<a href='../../core/primitive.array.html'>[B; 8]</a>) -> <a href='../../core/primitive.bool.html'>bool</a></code></h4> |
| 1560 |
<h4 id='method.ne' class='method'><code>fn <a href='../../core/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&self, other: &<a href='../../core/primitive.array.html'>[B; 8]</a>) -> <a href='../../core/primitive.bool.html'>bool</a></code></h4> |
| 1561 |
</div><h3 class='impl'><code>impl<'a, 'b, A: <a class='trait' href='../../core/marker/trait.Sized.html' title='core::marker::Sized'>Sized</a>, B> <a class='trait' href='../../core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a><&'b <a href='../../core/primitive.array.html'>[B; 8]</a>> for <a class='struct' href='../../collections/vec/struct.Vec.html' title='collections::vec::Vec'>Vec</a><A> <span class='where'>where A: <a class='trait' href='../../core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a><B></span></code></h3><div class='impl-items'><h4 id='method.eq' class='method'><code>fn <a href='../../core/cmp/trait.PartialEq.html#method.eq' class='fnname'>eq</a>(&self, other: &&'b <a href='../../core/primitive.array.html'>[B; 8]</a>) -> <a href='../../core/primitive.bool.html'>bool</a></code></h4> |
| 1562 |
<h4 id='method.ne' class='method'><code>fn <a href='../../core/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&self, other: &&'b <a href='../../core/primitive.array.html'>[B; 8]</a>) -> <a href='../../core/primitive.bool.html'>bool</a></code></h4> |
| 1563 |
</div><h3 class='impl'><code>impl<'a, 'b, A: <a class='trait' href='../../core/marker/trait.Sized.html' title='core::marker::Sized'>Sized</a>, B> <a class='trait' href='../../core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a><<a href='../../core/primitive.array.html'>[B; 9]</a>> for <a class='struct' href='../../collections/vec/struct.Vec.html' title='collections::vec::Vec'>Vec</a><A> <span class='where'>where A: <a class='trait' href='../../core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a><B></span></code></h3><div class='impl-items'><h4 id='method.eq' class='method'><code>fn <a href='../../core/cmp/trait.PartialEq.html#method.eq' class='fnname'>eq</a>(&self, other: &<a href='../../core/primitive.array.html'>[B; 9]</a>) -> <a href='../../core/primitive.bool.html'>bool</a></code></h4> |
| 1564 |
<h4 id='method.ne' class='method'><code>fn <a href='../../core/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&self, other: &<a href='../../core/primitive.array.html'>[B; 9]</a>) -> <a href='../../core/primitive.bool.html'>bool</a></code></h4> |
| 1565 |
</div><h3 class='impl'><code>impl<'a, 'b, A: <a class='trait' href='../../core/marker/trait.Sized.html' title='core::marker::Sized'>Sized</a>, B> <a class='trait' href='../../core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a><&'b <a href='../../core/primitive.array.html'>[B; 9]</a>> for <a class='struct' href='../../collections/vec/struct.Vec.html' title='collections::vec::Vec'>Vec</a><A> <span class='where'>where A: <a class='trait' href='../../core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a><B></span></code></h3><div class='impl-items'><h4 id='method.eq' class='method'><code>fn <a href='../../core/cmp/trait.PartialEq.html#method.eq' class='fnname'>eq</a>(&self, other: &&'b <a href='../../core/primitive.array.html'>[B; 9]</a>) -> <a href='../../core/primitive.bool.html'>bool</a></code></h4> |
| 1566 |
<h4 id='method.ne' class='method'><code>fn <a href='../../core/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&self, other: &&'b <a href='../../core/primitive.array.html'>[B; 9]</a>) -> <a href='../../core/primitive.bool.html'>bool</a></code></h4> |
| 1567 |
</div><h3 class='impl'><code>impl<'a, 'b, A: <a class='trait' href='../../core/marker/trait.Sized.html' title='core::marker::Sized'>Sized</a>, B> <a class='trait' href='../../core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a><<a href='../../core/primitive.array.html'>[B; 10]</a>> for <a class='struct' href='../../collections/vec/struct.Vec.html' title='collections::vec::Vec'>Vec</a><A> <span class='where'>where A: <a class='trait' href='../../core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a><B></span></code></h3><div class='impl-items'><h4 id='method.eq' class='method'><code>fn <a href='../../core/cmp/trait.PartialEq.html#method.eq' class='fnname'>eq</a>(&self, other: &<a href='../../core/primitive.array.html'>[B; 10]</a>) -> <a href='../../core/primitive.bool.html'>bool</a></code></h4> |
| 1568 |
<h4 id='method.ne' class='method'><code>fn <a href='../../core/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&self, other: &<a href='../../core/primitive.array.html'>[B; 10]</a>) -> <a href='../../core/primitive.bool.html'>bool</a></code></h4> |
| 1569 |
</div><h3 class='impl'><code>impl<'a, 'b, A: <a class='trait' href='../../core/marker/trait.Sized.html' title='core::marker::Sized'>Sized</a>, B> <a class='trait' href='../../core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a><&'b <a href='../../core/primitive.array.html'>[B; 10]</a>> for <a class='struct' href='../../collections/vec/struct.Vec.html' title='collections::vec::Vec'>Vec</a><A> <span class='where'>where A: <a class='trait' href='../../core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a><B></span></code></h3><div class='impl-items'><h4 id='method.eq' class='method'><code>fn <a href='../../core/cmp/trait.PartialEq.html#method.eq' class='fnname'>eq</a>(&self, other: &&'b <a href='../../core/primitive.array.html'>[B; 10]</a>) -> <a href='../../core/primitive.bool.html'>bool</a></code></h4> |
| 1570 |
<h4 id='method.ne' class='method'><code>fn <a href='../../core/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&self, other: &&'b <a href='../../core/primitive.array.html'>[B; 10]</a>) -> <a href='../../core/primitive.bool.html'>bool</a></code></h4> |
| 1571 |
</div><h3 class='impl'><code>impl<'a, 'b, A: <a class='trait' href='../../core/marker/trait.Sized.html' title='core::marker::Sized'>Sized</a>, B> <a class='trait' href='../../core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a><<a href='../../core/primitive.array.html'>[B; 11]</a>> for <a class='struct' href='../../collections/vec/struct.Vec.html' title='collections::vec::Vec'>Vec</a><A> <span class='where'>where A: <a class='trait' href='../../core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a><B></span></code></h3><div class='impl-items'><h4 id='method.eq' class='method'><code>fn <a href='../../core/cmp/trait.PartialEq.html#method.eq' class='fnname'>eq</a>(&self, other: &<a href='../../core/primitive.array.html'>[B; 11]</a>) -> <a href='../../core/primitive.bool.html'>bool</a></code></h4> |
| 1572 |
<h4 id='method.ne' class='method'><code>fn <a href='../../core/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&self, other: &<a href='../../core/primitive.array.html'>[B; 11]</a>) -> <a href='../../core/primitive.bool.html'>bool</a></code></h4> |
| 1573 |
</div><h3 class='impl'><code>impl<'a, 'b, A: <a class='trait' href='../../core/marker/trait.Sized.html' title='core::marker::Sized'>Sized</a>, B> <a class='trait' href='../../core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a><&'b <a href='../../core/primitive.array.html'>[B; 11]</a>> for <a class='struct' href='../../collections/vec/struct.Vec.html' title='collections::vec::Vec'>Vec</a><A> <span class='where'>where A: <a class='trait' href='../../core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a><B></span></code></h3><div class='impl-items'><h4 id='method.eq' class='method'><code>fn <a href='../../core/cmp/trait.PartialEq.html#method.eq' class='fnname'>eq</a>(&self, other: &&'b <a href='../../core/primitive.array.html'>[B; 11]</a>) -> <a href='../../core/primitive.bool.html'>bool</a></code></h4> |
| 1574 |
<h4 id='method.ne' class='method'><code>fn <a href='../../core/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&self, other: &&'b <a href='../../core/primitive.array.html'>[B; 11]</a>) -> <a href='../../core/primitive.bool.html'>bool</a></code></h4> |
| 1575 |
</div><h3 class='impl'><code>impl<'a, 'b, A: <a class='trait' href='../../core/marker/trait.Sized.html' title='core::marker::Sized'>Sized</a>, B> <a class='trait' href='../../core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a><<a href='../../core/primitive.array.html'>[B; 12]</a>> for <a class='struct' href='../../collections/vec/struct.Vec.html' title='collections::vec::Vec'>Vec</a><A> <span class='where'>where A: <a class='trait' href='../../core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a><B></span></code></h3><div class='impl-items'><h4 id='method.eq' class='method'><code>fn <a href='../../core/cmp/trait.PartialEq.html#method.eq' class='fnname'>eq</a>(&self, other: &<a href='../../core/primitive.array.html'>[B; 12]</a>) -> <a href='../../core/primitive.bool.html'>bool</a></code></h4> |
| 1576 |
<h4 id='method.ne' class='method'><code>fn <a href='../../core/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&self, other: &<a href='../../core/primitive.array.html'>[B; 12]</a>) -> <a href='../../core/primitive.bool.html'>bool</a></code></h4> |
| 1577 |
</div><h3 class='impl'><code>impl<'a, 'b, A: <a class='trait' href='../../core/marker/trait.Sized.html' title='core::marker::Sized'>Sized</a>, B> <a class='trait' href='../../core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a><&'b <a href='../../core/primitive.array.html'>[B; 12]</a>> for <a class='struct' href='../../collections/vec/struct.Vec.html' title='collections::vec::Vec'>Vec</a><A> <span class='where'>where A: <a class='trait' href='../../core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a><B></span></code></h3><div class='impl-items'><h4 id='method.eq' class='method'><code>fn <a href='../../core/cmp/trait.PartialEq.html#method.eq' class='fnname'>eq</a>(&self, other: &&'b <a href='../../core/primitive.array.html'>[B; 12]</a>) -> <a href='../../core/primitive.bool.html'>bool</a></code></h4> |
| 1578 |
<h4 id='method.ne' class='method'><code>fn <a href='../../core/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&self, other: &&'b <a href='../../core/primitive.array.html'>[B; 12]</a>) -> <a href='../../core/primitive.bool.html'>bool</a></code></h4> |
| 1579 |
</div><h3 class='impl'><code>impl<'a, 'b, A: <a class='trait' href='../../core/marker/trait.Sized.html' title='core::marker::Sized'>Sized</a>, B> <a class='trait' href='../../core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a><<a href='../../core/primitive.array.html'>[B; 13]</a>> for <a class='struct' href='../../collections/vec/struct.Vec.html' title='collections::vec::Vec'>Vec</a><A> <span class='where'>where A: <a class='trait' href='../../core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a><B></span></code></h3><div class='impl-items'><h4 id='method.eq' class='method'><code>fn <a href='../../core/cmp/trait.PartialEq.html#method.eq' class='fnname'>eq</a>(&self, other: &<a href='../../core/primitive.array.html'>[B; 13]</a>) -> <a href='../../core/primitive.bool.html'>bool</a></code></h4> |
| 1580 |
<h4 id='method.ne' class='method'><code>fn <a href='../../core/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&self, other: &<a href='../../core/primitive.array.html'>[B; 13]</a>) -> <a href='../../core/primitive.bool.html'>bool</a></code></h4> |
| 1581 |
</div><h3 class='impl'><code>impl<'a, 'b, A: <a class='trait' href='../../core/marker/trait.Sized.html' title='core::marker::Sized'>Sized</a>, B> <a class='trait' href='../../core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a><&'b <a href='../../core/primitive.array.html'>[B; 13]</a>> for <a class='struct' href='../../collections/vec/struct.Vec.html' title='collections::vec::Vec'>Vec</a><A> <span class='where'>where A: <a class='trait' href='../../core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a><B></span></code></h3><div class='impl-items'><h4 id='method.eq' class='method'><code>fn <a href='../../core/cmp/trait.PartialEq.html#method.eq' class='fnname'>eq</a>(&self, other: &&'b <a href='../../core/primitive.array.html'>[B; 13]</a>) -> <a href='../../core/primitive.bool.html'>bool</a></code></h4> |
| 1582 |
<h4 id='method.ne' class='method'><code>fn <a href='../../core/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&self, other: &&'b <a href='../../core/primitive.array.html'>[B; 13]</a>) -> <a href='../../core/primitive.bool.html'>bool</a></code></h4> |
| 1583 |
</div><h3 class='impl'><code>impl<'a, 'b, A: <a class='trait' href='../../core/marker/trait.Sized.html' title='core::marker::Sized'>Sized</a>, B> <a class='trait' href='../../core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a><<a href='../../core/primitive.array.html'>[B; 14]</a>> for <a class='struct' href='../../collections/vec/struct.Vec.html' title='collections::vec::Vec'>Vec</a><A> <span class='where'>where A: <a class='trait' href='../../core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a><B></span></code></h3><div class='impl-items'><h4 id='method.eq' class='method'><code>fn <a href='../../core/cmp/trait.PartialEq.html#method.eq' class='fnname'>eq</a>(&self, other: &<a href='../../core/primitive.array.html'>[B; 14]</a>) -> <a href='../../core/primitive.bool.html'>bool</a></code></h4> |
| 1584 |
<h4 id='method.ne' class='method'><code>fn <a href='../../core/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&self, other: &<a href='../../core/primitive.array.html'>[B; 14]</a>) -> <a href='../../core/primitive.bool.html'>bool</a></code></h4> |
| 1585 |
</div><h3 class='impl'><code>impl<'a, 'b, A: <a class='trait' href='../../core/marker/trait.Sized.html' title='core::marker::Sized'>Sized</a>, B> <a class='trait' href='../../core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a><&'b <a href='../../core/primitive.array.html'>[B; 14]</a>> for <a class='struct' href='../../collections/vec/struct.Vec.html' title='collections::vec::Vec'>Vec</a><A> <span class='where'>where A: <a class='trait' href='../../core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a><B></span></code></h3><div class='impl-items'><h4 id='method.eq' class='method'><code>fn <a href='../../core/cmp/trait.PartialEq.html#method.eq' class='fnname'>eq</a>(&self, other: &&'b <a href='../../core/primitive.array.html'>[B; 14]</a>) -> <a href='../../core/primitive.bool.html'>bool</a></code></h4> |
| 1586 |
<h4 id='method.ne' class='method'><code>fn <a href='../../core/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&self, other: &&'b <a href='../../core/primitive.array.html'>[B; 14]</a>) -> <a href='../../core/primitive.bool.html'>bool</a></code></h4> |
| 1587 |
</div><h3 class='impl'><code>impl<'a, 'b, A: <a class='trait' href='../../core/marker/trait.Sized.html' title='core::marker::Sized'>Sized</a>, B> <a class='trait' href='../../core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a><<a href='../../core/primitive.array.html'>[B; 15]</a>> for <a class='struct' href='../../collections/vec/struct.Vec.html' title='collections::vec::Vec'>Vec</a><A> <span class='where'>where A: <a class='trait' href='../../core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a><B></span></code></h3><div class='impl-items'><h4 id='method.eq' class='method'><code>fn <a href='../../core/cmp/trait.PartialEq.html#method.eq' class='fnname'>eq</a>(&self, other: &<a href='../../core/primitive.array.html'>[B; 15]</a>) -> <a href='../../core/primitive.bool.html'>bool</a></code></h4> |
| 1588 |
<h4 id='method.ne' class='method'><code>fn <a href='../../core/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&self, other: &<a href='../../core/primitive.array.html'>[B; 15]</a>) -> <a href='../../core/primitive.bool.html'>bool</a></code></h4> |
| 1589 |
</div><h3 class='impl'><code>impl<'a, 'b, A: <a class='trait' href='../../core/marker/trait.Sized.html' title='core::marker::Sized'>Sized</a>, B> <a class='trait' href='../../core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a><&'b <a href='../../core/primitive.array.html'>[B; 15]</a>> for <a class='struct' href='../../collections/vec/struct.Vec.html' title='collections::vec::Vec'>Vec</a><A> <span class='where'>where A: <a class='trait' href='../../core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a><B></span></code></h3><div class='impl-items'><h4 id='method.eq' class='method'><code>fn <a href='../../core/cmp/trait.PartialEq.html#method.eq' class='fnname'>eq</a>(&self, other: &&'b <a href='../../core/primitive.array.html'>[B; 15]</a>) -> <a href='../../core/primitive.bool.html'>bool</a></code></h4> |
| 1590 |
<h4 id='method.ne' class='method'><code>fn <a href='../../core/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&self, other: &&'b <a href='../../core/primitive.array.html'>[B; 15]</a>) -> <a href='../../core/primitive.bool.html'>bool</a></code></h4> |
| 1591 |
</div><h3 class='impl'><code>impl<'a, 'b, A: <a class='trait' href='../../core/marker/trait.Sized.html' title='core::marker::Sized'>Sized</a>, B> <a class='trait' href='../../core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a><<a href='../../core/primitive.array.html'>[B; 16]</a>> for <a class='struct' href='../../collections/vec/struct.Vec.html' title='collections::vec::Vec'>Vec</a><A> <span class='where'>where A: <a class='trait' href='../../core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a><B></span></code></h3><div class='impl-items'><h4 id='method.eq' class='method'><code>fn <a href='../../core/cmp/trait.PartialEq.html#method.eq' class='fnname'>eq</a>(&self, other: &<a href='../../core/primitive.array.html'>[B; 16]</a>) -> <a href='../../core/primitive.bool.html'>bool</a></code></h4> |
| 1592 |
<h4 id='method.ne' class='method'><code>fn <a href='../../core/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&self, other: &<a href='../../core/primitive.array.html'>[B; 16]</a>) -> <a href='../../core/primitive.bool.html'>bool</a></code></h4> |
| 1593 |
</div><h3 class='impl'><code>impl<'a, 'b, A: <a class='trait' href='../../core/marker/trait.Sized.html' title='core::marker::Sized'>Sized</a>, B> <a class='trait' href='../../core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a><&'b <a href='../../core/primitive.array.html'>[B; 16]</a>> for <a class='struct' href='../../collections/vec/struct.Vec.html' title='collections::vec::Vec'>Vec</a><A> <span class='where'>where A: <a class='trait' href='../../core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a><B></span></code></h3><div class='impl-items'><h4 id='method.eq' class='method'><code>fn <a href='../../core/cmp/trait.PartialEq.html#method.eq' class='fnname'>eq</a>(&self, other: &&'b <a href='../../core/primitive.array.html'>[B; 16]</a>) -> <a href='../../core/primitive.bool.html'>bool</a></code></h4> |
| 1594 |
<h4 id='method.ne' class='method'><code>fn <a href='../../core/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&self, other: &&'b <a href='../../core/primitive.array.html'>[B; 16]</a>) -> <a href='../../core/primitive.bool.html'>bool</a></code></h4> |
| 1595 |
</div><h3 class='impl'><code>impl<'a, 'b, A: <a class='trait' href='../../core/marker/trait.Sized.html' title='core::marker::Sized'>Sized</a>, B> <a class='trait' href='../../core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a><<a href='../../core/primitive.array.html'>[B; 17]</a>> for <a class='struct' href='../../collections/vec/struct.Vec.html' title='collections::vec::Vec'>Vec</a><A> <span class='where'>where A: <a class='trait' href='../../core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a><B></span></code></h3><div class='impl-items'><h4 id='method.eq' class='method'><code>fn <a href='../../core/cmp/trait.PartialEq.html#method.eq' class='fnname'>eq</a>(&self, other: &<a href='../../core/primitive.array.html'>[B; 17]</a>) -> <a href='../../core/primitive.bool.html'>bool</a></code></h4> |
| 1596 |
<h4 id='method.ne' class='method'><code>fn <a href='../../core/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&self, other: &<a href='../../core/primitive.array.html'>[B; 17]</a>) -> <a href='../../core/primitive.bool.html'>bool</a></code></h4> |
| 1597 |
</div><h3 class='impl'><code>impl<'a, 'b, A: <a class='trait' href='../../core/marker/trait.Sized.html' title='core::marker::Sized'>Sized</a>, B> <a class='trait' href='../../core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a><&'b <a href='../../core/primitive.array.html'>[B; 17]</a>> for <a class='struct' href='../../collections/vec/struct.Vec.html' title='collections::vec::Vec'>Vec</a><A> <span class='where'>where A: <a class='trait' href='../../core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a><B></span></code></h3><div class='impl-items'><h4 id='method.eq' class='method'><code>fn <a href='../../core/cmp/trait.PartialEq.html#method.eq' class='fnname'>eq</a>(&self, other: &&'b <a href='../../core/primitive.array.html'>[B; 17]</a>) -> <a href='../../core/primitive.bool.html'>bool</a></code></h4> |
| 1598 |
<h4 id='method.ne' class='method'><code>fn <a href='../../core/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&self, other: &&'b <a href='../../core/primitive.array.html'>[B; 17]</a>) -> <a href='../../core/primitive.bool.html'>bool</a></code></h4> |
| 1599 |
</div><h3 class='impl'><code>impl<'a, 'b, A: <a class='trait' href='../../core/marker/trait.Sized.html' title='core::marker::Sized'>Sized</a>, B> <a class='trait' href='../../core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a><<a href='../../core/primitive.array.html'>[B; 18]</a>> for <a class='struct' href='../../collections/vec/struct.Vec.html' title='collections::vec::Vec'>Vec</a><A> <span class='where'>where A: <a class='trait' href='../../core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a><B></span></code></h3><div class='impl-items'><h4 id='method.eq' class='method'><code>fn <a href='../../core/cmp/trait.PartialEq.html#method.eq' class='fnname'>eq</a>(&self, other: &<a href='../../core/primitive.array.html'>[B; 18]</a>) -> <a href='../../core/primitive.bool.html'>bool</a></code></h4> |
| 1600 |
<h4 id='method.ne' class='method'><code>fn <a href='../../core/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&self, other: &<a href='../../core/primitive.array.html'>[B; 18]</a>) -> <a href='../../core/primitive.bool.html'>bool</a></code></h4> |
| 1601 |
</div><h3 class='impl'><code>impl<'a, 'b, A: <a class='trait' href='../../core/marker/trait.Sized.html' title='core::marker::Sized'>Sized</a>, B> <a class='trait' href='../../core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a><&'b <a href='../../core/primitive.array.html'>[B; 18]</a>> for <a class='struct' href='../../collections/vec/struct.Vec.html' title='collections::vec::Vec'>Vec</a><A> <span class='where'>where A: <a class='trait' href='../../core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a><B></span></code></h3><div class='impl-items'><h4 id='method.eq' class='method'><code>fn <a href='../../core/cmp/trait.PartialEq.html#method.eq' class='fnname'>eq</a>(&self, other: &&'b <a href='../../core/primitive.array.html'>[B; 18]</a>) -> <a href='../../core/primitive.bool.html'>bool</a></code></h4> |
| 1602 |
<h4 id='method.ne' class='method'><code>fn <a href='../../core/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&self, other: &&'b <a href='../../core/primitive.array.html'>[B; 18]</a>) -> <a href='../../core/primitive.bool.html'>bool</a></code></h4> |
| 1603 |
</div><h3 class='impl'><code>impl<'a, 'b, A: <a class='trait' href='../../core/marker/trait.Sized.html' title='core::marker::Sized'>Sized</a>, B> <a class='trait' href='../../core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a><<a href='../../core/primitive.array.html'>[B; 19]</a>> for <a class='struct' href='../../collections/vec/struct.Vec.html' title='collections::vec::Vec'>Vec</a><A> <span class='where'>where A: <a class='trait' href='../../core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a><B></span></code></h3><div class='impl-items'><h4 id='method.eq' class='method'><code>fn <a href='../../core/cmp/trait.PartialEq.html#method.eq' class='fnname'>eq</a>(&self, other: &<a href='../../core/primitive.array.html'>[B; 19]</a>) -> <a href='../../core/primitive.bool.html'>bool</a></code></h4> |
| 1604 |
<h4 id='method.ne' class='method'><code>fn <a href='../../core/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&self, other: &<a href='../../core/primitive.array.html'>[B; 19]</a>) -> <a href='../../core/primitive.bool.html'>bool</a></code></h4> |
| 1605 |
</div><h3 class='impl'><code>impl<'a, 'b, A: <a class='trait' href='../../core/marker/trait.Sized.html' title='core::marker::Sized'>Sized</a>, B> <a class='trait' href='../../core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a><&'b <a href='../../core/primitive.array.html'>[B; 19]</a>> for <a class='struct' href='../../collections/vec/struct.Vec.html' title='collections::vec::Vec'>Vec</a><A> <span class='where'>where A: <a class='trait' href='../../core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a><B></span></code></h3><div class='impl-items'><h4 id='method.eq' class='method'><code>fn <a href='../../core/cmp/trait.PartialEq.html#method.eq' class='fnname'>eq</a>(&self, other: &&'b <a href='../../core/primitive.array.html'>[B; 19]</a>) -> <a href='../../core/primitive.bool.html'>bool</a></code></h4> |
| 1606 |
<h4 id='method.ne' class='method'><code>fn <a href='../../core/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&self, other: &&'b <a href='../../core/primitive.array.html'>[B; 19]</a>) -> <a href='../../core/primitive.bool.html'>bool</a></code></h4> |
| 1607 |
</div><h3 class='impl'><code>impl<'a, 'b, A: <a class='trait' href='../../core/marker/trait.Sized.html' title='core::marker::Sized'>Sized</a>, B> <a class='trait' href='../../core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a><<a href='../../core/primitive.array.html'>[B; 20]</a>> for <a class='struct' href='../../collections/vec/struct.Vec.html' title='collections::vec::Vec'>Vec</a><A> <span class='where'>where A: <a class='trait' href='../../core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a><B></span></code></h3><div class='impl-items'><h4 id='method.eq' class='method'><code>fn <a href='../../core/cmp/trait.PartialEq.html#method.eq' class='fnname'>eq</a>(&self, other: &<a href='../../core/primitive.array.html'>[B; 20]</a>) -> <a href='../../core/primitive.bool.html'>bool</a></code></h4> |
| 1608 |
<h4 id='method.ne' class='method'><code>fn <a href='../../core/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&self, other: &<a href='../../core/primitive.array.html'>[B; 20]</a>) -> <a href='../../core/primitive.bool.html'>bool</a></code></h4> |
| 1609 |
</div><h3 class='impl'><code>impl<'a, 'b, A: <a class='trait' href='../../core/marker/trait.Sized.html' title='core::marker::Sized'>Sized</a>, B> <a class='trait' href='../../core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a><&'b <a href='../../core/primitive.array.html'>[B; 20]</a>> for <a class='struct' href='../../collections/vec/struct.Vec.html' title='collections::vec::Vec'>Vec</a><A> <span class='where'>where A: <a class='trait' href='../../core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a><B></span></code></h3><div class='impl-items'><h4 id='method.eq' class='method'><code>fn <a href='../../core/cmp/trait.PartialEq.html#method.eq' class='fnname'>eq</a>(&self, other: &&'b <a href='../../core/primitive.array.html'>[B; 20]</a>) -> <a href='../../core/primitive.bool.html'>bool</a></code></h4> |
| 1610 |
<h4 id='method.ne' class='method'><code>fn <a href='../../core/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&self, other: &&'b <a href='../../core/primitive.array.html'>[B; 20]</a>) -> <a href='../../core/primitive.bool.html'>bool</a></code></h4> |
| 1611 |
</div><h3 class='impl'><code>impl<'a, 'b, A: <a class='trait' href='../../core/marker/trait.Sized.html' title='core::marker::Sized'>Sized</a>, B> <a class='trait' href='../../core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a><<a href='../../core/primitive.array.html'>[B; 21]</a>> for <a class='struct' href='../../collections/vec/struct.Vec.html' title='collections::vec::Vec'>Vec</a><A> <span class='where'>where A: <a class='trait' href='../../core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a><B></span></code></h3><div class='impl-items'><h4 id='method.eq' class='method'><code>fn <a href='../../core/cmp/trait.PartialEq.html#method.eq' class='fnname'>eq</a>(&self, other: &<a href='../../core/primitive.array.html'>[B; 21]</a>) -> <a href='../../core/primitive.bool.html'>bool</a></code></h4> |
| 1612 |
<h4 id='method.ne' class='method'><code>fn <a href='../../core/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&self, other: &<a href='../../core/primitive.array.html'>[B; 21]</a>) -> <a href='../../core/primitive.bool.html'>bool</a></code></h4> |
| 1613 |
</div><h3 class='impl'><code>impl<'a, 'b, A: <a class='trait' href='../../core/marker/trait.Sized.html' title='core::marker::Sized'>Sized</a>, B> <a class='trait' href='../../core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a><&'b <a href='../../core/primitive.array.html'>[B; 21]</a>> for <a class='struct' href='../../collections/vec/struct.Vec.html' title='collections::vec::Vec'>Vec</a><A> <span class='where'>where A: <a class='trait' href='../../core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a><B></span></code></h3><div class='impl-items'><h4 id='method.eq' class='method'><code>fn <a href='../../core/cmp/trait.PartialEq.html#method.eq' class='fnname'>eq</a>(&self, other: &&'b <a href='../../core/primitive.array.html'>[B; 21]</a>) -> <a href='../../core/primitive.bool.html'>bool</a></code></h4> |
| 1614 |
<h4 id='method.ne' class='method'><code>fn <a href='../../core/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&self, other: &&'b <a href='../../core/primitive.array.html'>[B; 21]</a>) -> <a href='../../core/primitive.bool.html'>bool</a></code></h4> |
| 1615 |
</div><h3 class='impl'><code>impl<'a, 'b, A: <a class='trait' href='../../core/marker/trait.Sized.html' title='core::marker::Sized'>Sized</a>, B> <a class='trait' href='../../core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a><<a href='../../core/primitive.array.html'>[B; 22]</a>> for <a class='struct' href='../../collections/vec/struct.Vec.html' title='collections::vec::Vec'>Vec</a><A> <span class='where'>where A: <a class='trait' href='../../core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a><B></span></code></h3><div class='impl-items'><h4 id='method.eq' class='method'><code>fn <a href='../../core/cmp/trait.PartialEq.html#method.eq' class='fnname'>eq</a>(&self, other: &<a href='../../core/primitive.array.html'>[B; 22]</a>) -> <a href='../../core/primitive.bool.html'>bool</a></code></h4> |
| 1616 |
<h4 id='method.ne' class='method'><code>fn <a href='../../core/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&self, other: &<a href='../../core/primitive.array.html'>[B; 22]</a>) -> <a href='../../core/primitive.bool.html'>bool</a></code></h4> |
| 1617 |
</div><h3 class='impl'><code>impl<'a, 'b, A: <a class='trait' href='../../core/marker/trait.Sized.html' title='core::marker::Sized'>Sized</a>, B> <a class='trait' href='../../core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a><&'b <a href='../../core/primitive.array.html'>[B; 22]</a>> for <a class='struct' href='../../collections/vec/struct.Vec.html' title='collections::vec::Vec'>Vec</a><A> <span class='where'>where A: <a class='trait' href='../../core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a><B></span></code></h3><div class='impl-items'><h4 id='method.eq' class='method'><code>fn <a href='../../core/cmp/trait.PartialEq.html#method.eq' class='fnname'>eq</a>(&self, other: &&'b <a href='../../core/primitive.array.html'>[B; 22]</a>) -> <a href='../../core/primitive.bool.html'>bool</a></code></h4> |
| 1618 |
<h4 id='method.ne' class='method'><code>fn <a href='../../core/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&self, other: &&'b <a href='../../core/primitive.array.html'>[B; 22]</a>) -> <a href='../../core/primitive.bool.html'>bool</a></code></h4> |
| 1619 |
</div><h3 class='impl'><code>impl<'a, 'b, A: <a class='trait' href='../../core/marker/trait.Sized.html' title='core::marker::Sized'>Sized</a>, B> <a class='trait' href='../../core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a><<a href='../../core/primitive.array.html'>[B; 23]</a>> for <a class='struct' href='../../collections/vec/struct.Vec.html' title='collections::vec::Vec'>Vec</a><A> <span class='where'>where A: <a class='trait' href='../../core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a><B></span></code></h3><div class='impl-items'><h4 id='method.eq' class='method'><code>fn <a href='../../core/cmp/trait.PartialEq.html#method.eq' class='fnname'>eq</a>(&self, other: &<a href='../../core/primitive.array.html'>[B; 23]</a>) -> <a href='../../core/primitive.bool.html'>bool</a></code></h4> |
| 1620 |
<h4 id='method.ne' class='method'><code>fn <a href='../../core/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&self, other: &<a href='../../core/primitive.array.html'>[B; 23]</a>) -> <a href='../../core/primitive.bool.html'>bool</a></code></h4> |
| 1621 |
</div><h3 class='impl'><code>impl<'a, 'b, A: <a class='trait' href='../../core/marker/trait.Sized.html' title='core::marker::Sized'>Sized</a>, B> <a class='trait' href='../../core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a><&'b <a href='../../core/primitive.array.html'>[B; 23]</a>> for <a class='struct' href='../../collections/vec/struct.Vec.html' title='collections::vec::Vec'>Vec</a><A> <span class='where'>where A: <a class='trait' href='../../core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a><B></span></code></h3><div class='impl-items'><h4 id='method.eq' class='method'><code>fn <a href='../../core/cmp/trait.PartialEq.html#method.eq' class='fnname'>eq</a>(&self, other: &&'b <a href='../../core/primitive.array.html'>[B; 23]</a>) -> <a href='../../core/primitive.bool.html'>bool</a></code></h4> |
| 1622 |
<h4 id='method.ne' class='method'><code>fn <a href='../../core/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&self, other: &&'b <a href='../../core/primitive.array.html'>[B; 23]</a>) -> <a href='../../core/primitive.bool.html'>bool</a></code></h4> |
| 1623 |
</div><h3 class='impl'><code>impl<'a, 'b, A: <a class='trait' href='../../core/marker/trait.Sized.html' title='core::marker::Sized'>Sized</a>, B> <a class='trait' href='../../core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a><<a href='../../core/primitive.array.html'>[B; 24]</a>> for <a class='struct' href='../../collections/vec/struct.Vec.html' title='collections::vec::Vec'>Vec</a><A> <span class='where'>where A: <a class='trait' href='../../core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a><B></span></code></h3><div class='impl-items'><h4 id='method.eq' class='method'><code>fn <a href='../../core/cmp/trait.PartialEq.html#method.eq' class='fnname'>eq</a>(&self, other: &<a href='../../core/primitive.array.html'>[B; 24]</a>) -> <a href='../../core/primitive.bool.html'>bool</a></code></h4> |
| 1624 |
<h4 id='method.ne' class='method'><code>fn <a href='../../core/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&self, other: &<a href='../../core/primitive.array.html'>[B; 24]</a>) -> <a href='../../core/primitive.bool.html'>bool</a></code></h4> |
| 1625 |
</div><h3 class='impl'><code>impl<'a, 'b, A: <a class='trait' href='../../core/marker/trait.Sized.html' title='core::marker::Sized'>Sized</a>, B> <a class='trait' href='../../core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a><&'b <a href='../../core/primitive.array.html'>[B; 24]</a>> for <a class='struct' href='../../collections/vec/struct.Vec.html' title='collections::vec::Vec'>Vec</a><A> <span class='where'>where A: <a class='trait' href='../../core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a><B></span></code></h3><div class='impl-items'><h4 id='method.eq' class='method'><code>fn <a href='../../core/cmp/trait.PartialEq.html#method.eq' class='fnname'>eq</a>(&self, other: &&'b <a href='../../core/primitive.array.html'>[B; 24]</a>) -> <a href='../../core/primitive.bool.html'>bool</a></code></h4> |
| 1626 |
<h4 id='method.ne' class='method'><code>fn <a href='../../core/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&self, other: &&'b <a href='../../core/primitive.array.html'>[B; 24]</a>) -> <a href='../../core/primitive.bool.html'>bool</a></code></h4> |
| 1627 |
</div><h3 class='impl'><code>impl<'a, 'b, A: <a class='trait' href='../../core/marker/trait.Sized.html' title='core::marker::Sized'>Sized</a>, B> <a class='trait' href='../../core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a><<a href='../../core/primitive.array.html'>[B; 25]</a>> for <a class='struct' href='../../collections/vec/struct.Vec.html' title='collections::vec::Vec'>Vec</a><A> <span class='where'>where A: <a class='trait' href='../../core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a><B></span></code></h3><div class='impl-items'><h4 id='method.eq' class='method'><code>fn <a href='../../core/cmp/trait.PartialEq.html#method.eq' class='fnname'>eq</a>(&self, other: &<a href='../../core/primitive.array.html'>[B; 25]</a>) -> <a href='../../core/primitive.bool.html'>bool</a></code></h4> |
| 1628 |
<h4 id='method.ne' class='method'><code>fn <a href='../../core/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&self, other: &<a href='../../core/primitive.array.html'>[B; 25]</a>) -> <a href='../../core/primitive.bool.html'>bool</a></code></h4> |
| 1629 |
</div><h3 class='impl'><code>impl<'a, 'b, A: <a class='trait' href='../../core/marker/trait.Sized.html' title='core::marker::Sized'>Sized</a>, B> <a class='trait' href='../../core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a><&'b <a href='../../core/primitive.array.html'>[B; 25]</a>> for <a class='struct' href='../../collections/vec/struct.Vec.html' title='collections::vec::Vec'>Vec</a><A> <span class='where'>where A: <a class='trait' href='../../core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a><B></span></code></h3><div class='impl-items'><h4 id='method.eq' class='method'><code>fn <a href='../../core/cmp/trait.PartialEq.html#method.eq' class='fnname'>eq</a>(&self, other: &&'b <a href='../../core/primitive.array.html'>[B; 25]</a>) -> <a href='../../core/primitive.bool.html'>bool</a></code></h4> |
| 1630 |
<h4 id='method.ne' class='method'><code>fn <a href='../../core/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&self, other: &&'b <a href='../../core/primitive.array.html'>[B; 25]</a>) -> <a href='../../core/primitive.bool.html'>bool</a></code></h4> |
| 1631 |
</div><h3 class='impl'><code>impl<'a, 'b, A: <a class='trait' href='../../core/marker/trait.Sized.html' title='core::marker::Sized'>Sized</a>, B> <a class='trait' href='../../core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a><<a href='../../core/primitive.array.html'>[B; 26]</a>> for <a class='struct' href='../../collections/vec/struct.Vec.html' title='collections::vec::Vec'>Vec</a><A> <span class='where'>where A: <a class='trait' href='../../core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a><B></span></code></h3><div class='impl-items'><h4 id='method.eq' class='method'><code>fn <a href='../../core/cmp/trait.PartialEq.html#method.eq' class='fnname'>eq</a>(&self, other: &<a href='../../core/primitive.array.html'>[B; 26]</a>) -> <a href='../../core/primitive.bool.html'>bool</a></code></h4> |
| 1632 |
<h4 id='method.ne' class='method'><code>fn <a href='../../core/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&self, other: &<a href='../../core/primitive.array.html'>[B; 26]</a>) -> <a href='../../core/primitive.bool.html'>bool</a></code></h4> |
| 1633 |
</div><h3 class='impl'><code>impl<'a, 'b, A: <a class='trait' href='../../core/marker/trait.Sized.html' title='core::marker::Sized'>Sized</a>, B> <a class='trait' href='../../core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a><&'b <a href='../../core/primitive.array.html'>[B; 26]</a>> for <a class='struct' href='../../collections/vec/struct.Vec.html' title='collections::vec::Vec'>Vec</a><A> <span class='where'>where A: <a class='trait' href='../../core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a><B></span></code></h3><div class='impl-items'><h4 id='method.eq' class='method'><code>fn <a href='../../core/cmp/trait.PartialEq.html#method.eq' class='fnname'>eq</a>(&self, other: &&'b <a href='../../core/primitive.array.html'>[B; 26]</a>) -> <a href='../../core/primitive.bool.html'>bool</a></code></h4> |
| 1634 |
<h4 id='method.ne' class='method'><code>fn <a href='../../core/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&self, other: &&'b <a href='../../core/primitive.array.html'>[B; 26]</a>) -> <a href='../../core/primitive.bool.html'>bool</a></code></h4> |
| 1635 |
</div><h3 class='impl'><code>impl<'a, 'b, A: <a class='trait' href='../../core/marker/trait.Sized.html' title='core::marker::Sized'>Sized</a>, B> <a class='trait' href='../../core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a><<a href='../../core/primitive.array.html'>[B; 27]</a>> for <a class='struct' href='../../collections/vec/struct.Vec.html' title='collections::vec::Vec'>Vec</a><A> <span class='where'>where A: <a class='trait' href='../../core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a><B></span></code></h3><div class='impl-items'><h4 id='method.eq' class='method'><code>fn <a href='../../core/cmp/trait.PartialEq.html#method.eq' class='fnname'>eq</a>(&self, other: &<a href='../../core/primitive.array.html'>[B; 27]</a>) -> <a href='../../core/primitive.bool.html'>bool</a></code></h4> |
| 1636 |
<h4 id='method.ne' class='method'><code>fn <a href='../../core/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&self, other: &<a href='../../core/primitive.array.html'>[B; 27]</a>) -> <a href='../../core/primitive.bool.html'>bool</a></code></h4> |
| 1637 |
</div><h3 class='impl'><code>impl<'a, 'b, A: <a class='trait' href='../../core/marker/trait.Sized.html' title='core::marker::Sized'>Sized</a>, B> <a class='trait' href='../../core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a><&'b <a href='../../core/primitive.array.html'>[B; 27]</a>> for <a class='struct' href='../../collections/vec/struct.Vec.html' title='collections::vec::Vec'>Vec</a><A> <span class='where'>where A: <a class='trait' href='../../core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a><B></span></code></h3><div class='impl-items'><h4 id='method.eq' class='method'><code>fn <a href='../../core/cmp/trait.PartialEq.html#method.eq' class='fnname'>eq</a>(&self, other: &&'b <a href='../../core/primitive.array.html'>[B; 27]</a>) -> <a href='../../core/primitive.bool.html'>bool</a></code></h4> |
| 1638 |
<h4 id='method.ne' class='method'><code>fn <a href='../../core/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&self, other: &&'b <a href='../../core/primitive.array.html'>[B; 27]</a>) -> <a href='../../core/primitive.bool.html'>bool</a></code></h4> |
| 1639 |
</div><h3 class='impl'><code>impl<'a, 'b, A: <a class='trait' href='../../core/marker/trait.Sized.html' title='core::marker::Sized'>Sized</a>, B> <a class='trait' href='../../core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a><<a href='../../core/primitive.array.html'>[B; 28]</a>> for <a class='struct' href='../../collections/vec/struct.Vec.html' title='collections::vec::Vec'>Vec</a><A> <span class='where'>where A: <a class='trait' href='../../core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a><B></span></code></h3><div class='impl-items'><h4 id='method.eq' class='method'><code>fn <a href='../../core/cmp/trait.PartialEq.html#method.eq' class='fnname'>eq</a>(&self, other: &<a href='../../core/primitive.array.html'>[B; 28]</a>) -> <a href='../../core/primitive.bool.html'>bool</a></code></h4> |
| 1640 |
<h4 id='method.ne' class='method'><code>fn <a href='../../core/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&self, other: &<a href='../../core/primitive.array.html'>[B; 28]</a>) -> <a href='../../core/primitive.bool.html'>bool</a></code></h4> |
| 1641 |
</div><h3 class='impl'><code>impl<'a, 'b, A: <a class='trait' href='../../core/marker/trait.Sized.html' title='core::marker::Sized'>Sized</a>, B> <a class='trait' href='../../core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a><&'b <a href='../../core/primitive.array.html'>[B; 28]</a>> for <a class='struct' href='../../collections/vec/struct.Vec.html' title='collections::vec::Vec'>Vec</a><A> <span class='where'>where A: <a class='trait' href='../../core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a><B></span></code></h3><div class='impl-items'><h4 id='method.eq' class='method'><code>fn <a href='../../core/cmp/trait.PartialEq.html#method.eq' class='fnname'>eq</a>(&self, other: &&'b <a href='../../core/primitive.array.html'>[B; 28]</a>) -> <a href='../../core/primitive.bool.html'>bool</a></code></h4> |
| 1642 |
<h4 id='method.ne' class='method'><code>fn <a href='../../core/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&self, other: &&'b <a href='../../core/primitive.array.html'>[B; 28]</a>) -> <a href='../../core/primitive.bool.html'>bool</a></code></h4> |
| 1643 |
</div><h3 class='impl'><code>impl<'a, 'b, A: <a class='trait' href='../../core/marker/trait.Sized.html' title='core::marker::Sized'>Sized</a>, B> <a class='trait' href='../../core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a><<a href='../../core/primitive.array.html'>[B; 29]</a>> for <a class='struct' href='../../collections/vec/struct.Vec.html' title='collections::vec::Vec'>Vec</a><A> <span class='where'>where A: <a class='trait' href='../../core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a><B></span></code></h3><div class='impl-items'><h4 id='method.eq' class='method'><code>fn <a href='../../core/cmp/trait.PartialEq.html#method.eq' class='fnname'>eq</a>(&self, other: &<a href='../../core/primitive.array.html'>[B; 29]</a>) -> <a href='../../core/primitive.bool.html'>bool</a></code></h4> |
| 1644 |
<h4 id='method.ne' class='method'><code>fn <a href='../../core/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&self, other: &<a href='../../core/primitive.array.html'>[B; 29]</a>) -> <a href='../../core/primitive.bool.html'>bool</a></code></h4> |
| 1645 |
</div><h3 class='impl'><code>impl<'a, 'b, A: <a class='trait' href='../../core/marker/trait.Sized.html' title='core::marker::Sized'>Sized</a>, B> <a class='trait' href='../../core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a><&'b <a href='../../core/primitive.array.html'>[B; 29]</a>> for <a class='struct' href='../../collections/vec/struct.Vec.html' title='collections::vec::Vec'>Vec</a><A> <span class='where'>where A: <a class='trait' href='../../core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a><B></span></code></h3><div class='impl-items'><h4 id='method.eq' class='method'><code>fn <a href='../../core/cmp/trait.PartialEq.html#method.eq' class='fnname'>eq</a>(&self, other: &&'b <a href='../../core/primitive.array.html'>[B; 29]</a>) -> <a href='../../core/primitive.bool.html'>bool</a></code></h4> |
| 1646 |
<h4 id='method.ne' class='method'><code>fn <a href='../../core/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&self, other: &&'b <a href='../../core/primitive.array.html'>[B; 29]</a>) -> <a href='../../core/primitive.bool.html'>bool</a></code></h4> |
| 1647 |
</div><h3 class='impl'><code>impl<'a, 'b, A: <a class='trait' href='../../core/marker/trait.Sized.html' title='core::marker::Sized'>Sized</a>, B> <a class='trait' href='../../core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a><<a href='../../core/primitive.array.html'>[B; 30]</a>> for <a class='struct' href='../../collections/vec/struct.Vec.html' title='collections::vec::Vec'>Vec</a><A> <span class='where'>where A: <a class='trait' href='../../core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a><B></span></code></h3><div class='impl-items'><h4 id='method.eq' class='method'><code>fn <a href='../../core/cmp/trait.PartialEq.html#method.eq' class='fnname'>eq</a>(&self, other: &<a href='../../core/primitive.array.html'>[B; 30]</a>) -> <a href='../../core/primitive.bool.html'>bool</a></code></h4> |
| 1648 |
<h4 id='method.ne' class='method'><code>fn <a href='../../core/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&self, other: &<a href='../../core/primitive.array.html'>[B; 30]</a>) -> <a href='../../core/primitive.bool.html'>bool</a></code></h4> |
| 1649 |
</div><h3 class='impl'><code>impl<'a, 'b, A: <a class='trait' href='../../core/marker/trait.Sized.html' title='core::marker::Sized'>Sized</a>, B> <a class='trait' href='../../core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a><&'b <a href='../../core/primitive.array.html'>[B; 30]</a>> for <a class='struct' href='../../collections/vec/struct.Vec.html' title='collections::vec::Vec'>Vec</a><A> <span class='where'>where A: <a class='trait' href='../../core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a><B></span></code></h3><div class='impl-items'><h4 id='method.eq' class='method'><code>fn <a href='../../core/cmp/trait.PartialEq.html#method.eq' class='fnname'>eq</a>(&self, other: &&'b <a href='../../core/primitive.array.html'>[B; 30]</a>) -> <a href='../../core/primitive.bool.html'>bool</a></code></h4> |
| 1650 |
<h4 id='method.ne' class='method'><code>fn <a href='../../core/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&self, other: &&'b <a href='../../core/primitive.array.html'>[B; 30]</a>) -> <a href='../../core/primitive.bool.html'>bool</a></code></h4> |
| 1651 |
</div><h3 class='impl'><code>impl<'a, 'b, A: <a class='trait' href='../../core/marker/trait.Sized.html' title='core::marker::Sized'>Sized</a>, B> <a class='trait' href='../../core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a><<a href='../../core/primitive.array.html'>[B; 31]</a>> for <a class='struct' href='../../collections/vec/struct.Vec.html' title='collections::vec::Vec'>Vec</a><A> <span class='where'>where A: <a class='trait' href='../../core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a><B></span></code></h3><div class='impl-items'><h4 id='method.eq' class='method'><code>fn <a href='../../core/cmp/trait.PartialEq.html#method.eq' class='fnname'>eq</a>(&self, other: &<a href='../../core/primitive.array.html'>[B; 31]</a>) -> <a href='../../core/primitive.bool.html'>bool</a></code></h4> |
| 1652 |
<h4 id='method.ne' class='method'><code>fn <a href='../../core/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&self, other: &<a href='../../core/primitive.array.html'>[B; 31]</a>) -> <a href='../../core/primitive.bool.html'>bool</a></code></h4> |
| 1653 |
</div><h3 class='impl'><code>impl<'a, 'b, A: <a class='trait' href='../../core/marker/trait.Sized.html' title='core::marker::Sized'>Sized</a>, B> <a class='trait' href='../../core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a><&'b <a href='../../core/primitive.array.html'>[B; 31]</a>> for <a class='struct' href='../../collections/vec/struct.Vec.html' title='collections::vec::Vec'>Vec</a><A> <span class='where'>where A: <a class='trait' href='../../core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a><B></span></code></h3><div class='impl-items'><h4 id='method.eq' class='method'><code>fn <a href='../../core/cmp/trait.PartialEq.html#method.eq' class='fnname'>eq</a>(&self, other: &&'b <a href='../../core/primitive.array.html'>[B; 31]</a>) -> <a href='../../core/primitive.bool.html'>bool</a></code></h4> |
| 1654 |
<h4 id='method.ne' class='method'><code>fn <a href='../../core/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&self, other: &&'b <a href='../../core/primitive.array.html'>[B; 31]</a>) -> <a href='../../core/primitive.bool.html'>bool</a></code></h4> |
| 1655 |
</div><h3 class='impl'><code>impl<'a, 'b, A: <a class='trait' href='../../core/marker/trait.Sized.html' title='core::marker::Sized'>Sized</a>, B> <a class='trait' href='../../core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a><<a href='../../core/primitive.array.html'>[B; 32]</a>> for <a class='struct' href='../../collections/vec/struct.Vec.html' title='collections::vec::Vec'>Vec</a><A> <span class='where'>where A: <a class='trait' href='../../core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a><B></span></code></h3><div class='impl-items'><h4 id='method.eq' class='method'><code>fn <a href='../../core/cmp/trait.PartialEq.html#method.eq' class='fnname'>eq</a>(&self, other: &<a href='../../core/primitive.array.html'>[B; 32]</a>) -> <a href='../../core/primitive.bool.html'>bool</a></code></h4> |
| 1656 |
<h4 id='method.ne' class='method'><code>fn <a href='../../core/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&self, other: &<a href='../../core/primitive.array.html'>[B; 32]</a>) -> <a href='../../core/primitive.bool.html'>bool</a></code></h4> |
| 1657 |
</div><h3 class='impl'><code>impl<'a, 'b, A: <a class='trait' href='../../core/marker/trait.Sized.html' title='core::marker::Sized'>Sized</a>, B> <a class='trait' href='../../core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a><&'b <a href='../../core/primitive.array.html'>[B; 32]</a>> for <a class='struct' href='../../collections/vec/struct.Vec.html' title='collections::vec::Vec'>Vec</a><A> <span class='where'>where A: <a class='trait' href='../../core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a><B></span></code></h3><div class='impl-items'><h4 id='method.eq' class='method'><code>fn <a href='../../core/cmp/trait.PartialEq.html#method.eq' class='fnname'>eq</a>(&self, other: &&'b <a href='../../core/primitive.array.html'>[B; 32]</a>) -> <a href='../../core/primitive.bool.html'>bool</a></code></h4> |
| 1658 |
<h4 id='method.ne' class='method'><code>fn <a href='../../core/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&self, other: &&'b <a href='../../core/primitive.array.html'>[B; 32]</a>) -> <a href='../../core/primitive.bool.html'>bool</a></code></h4> |
| 1659 |
</div><h3 class='impl'><code>impl<T: <a class='trait' href='../../core/cmp/trait.PartialOrd.html' title='core::cmp::PartialOrd'>PartialOrd</a>> <a class='trait' href='../../core/cmp/trait.PartialOrd.html' title='core::cmp::PartialOrd'>PartialOrd</a> for <a class='struct' href='../../collections/vec/struct.Vec.html' title='collections::vec::Vec'>Vec</a><T></code></h3><div class='impl-items'><h4 id='method.partial_cmp' class='method'><code>fn <a href='../../core/cmp/trait.PartialOrd.html#method.partial_cmp' class='fnname'>partial_cmp</a>(&self, other: &<a class='struct' href='../../collections/vec/struct.Vec.html' title='collections::vec::Vec'>Vec</a><T>) -> <a class='enum' href='../../core/option/enum.Option.html' title='core::option::Option'>Option</a><<a class='enum' href='../../core/cmp/enum.Ordering.html' title='core::cmp::Ordering'>Ordering</a>></code></h4> |
| 1660 |
<h4 id='method.lt' class='method'><code>fn <a href='../../core/cmp/trait.PartialOrd.html#method.lt' class='fnname'>lt</a>(&self, other: &Rhs) -> <a href='../../core/primitive.bool.html'>bool</a></code></h4> |
| 1661 |
<h4 id='method.le' class='method'><code>fn <a href='../../core/cmp/trait.PartialOrd.html#method.le' class='fnname'>le</a>(&self, other: &Rhs) -> <a href='../../core/primitive.bool.html'>bool</a></code></h4> |
| 1662 |
<h4 id='method.gt' class='method'><code>fn <a href='../../core/cmp/trait.PartialOrd.html#method.gt' class='fnname'>gt</a>(&self, other: &Rhs) -> <a href='../../core/primitive.bool.html'>bool</a></code></h4> |
| 1663 |
<h4 id='method.ge' class='method'><code>fn <a href='../../core/cmp/trait.PartialOrd.html#method.ge' class='fnname'>ge</a>(&self, other: &Rhs) -> <a href='../../core/primitive.bool.html'>bool</a></code></h4> |
| 1664 |
</div><h3 class='impl'><code>impl<T: <a class='trait' href='../../core/cmp/trait.Eq.html' title='core::cmp::Eq'>Eq</a>> <a class='trait' href='../../core/cmp/trait.Eq.html' title='core::cmp::Eq'>Eq</a> for <a class='struct' href='../../collections/vec/struct.Vec.html' title='collections::vec::Vec'>Vec</a><T></code></h3><div class='impl-items'></div><h3 class='impl'><code>impl<T: <a class='trait' href='../../core/cmp/trait.Ord.html' title='core::cmp::Ord'>Ord</a>> <a class='trait' href='../../core/cmp/trait.Ord.html' title='core::cmp::Ord'>Ord</a> for <a class='struct' href='../../collections/vec/struct.Vec.html' title='collections::vec::Vec'>Vec</a><T></code></h3><div class='impl-items'><h4 id='method.cmp' class='method'><code>fn <a href='../../core/cmp/trait.Ord.html#method.cmp' class='fnname'>cmp</a>(&self, other: &<a class='struct' href='../../collections/vec/struct.Vec.html' title='collections::vec::Vec'>Vec</a><T>) -> <a class='enum' href='../../core/cmp/enum.Ordering.html' title='core::cmp::Ordering'>Ordering</a></code></h4> |
| 1665 |
</div><h3 class='impl'><code>impl<T> <a class='trait' href='../../core/ops/trait.Drop.html' title='core::ops::Drop'>Drop</a> for <a class='struct' href='../../collections/vec/struct.Vec.html' title='collections::vec::Vec'>Vec</a><T></code></h3><div class='impl-items'><h4 id='method.drop' class='method'><code>fn <a href='../../core/ops/trait.Drop.html#method.drop' class='fnname'>drop</a>(&mut self)</code></h4> |
| 1666 |
</div><h3 class='impl'><code>impl<T> <a class='trait' href='../../core/default/trait.Default.html' title='core::default::Default'>Default</a> for <a class='struct' href='../../collections/vec/struct.Vec.html' title='collections::vec::Vec'>Vec</a><T></code></h3><div class='impl-items'><h4 id='method.default' class='method'><code>fn <a href='../../core/default/trait.Default.html#method.default' class='fnname'>default</a>() -> <a class='struct' href='../../collections/vec/struct.Vec.html' title='collections::vec::Vec'>Vec</a><T></code></h4> |
| 1667 |
</div><h3 class='impl'><code>impl<T: <a class='trait' href='../../collections/fmt/trait.Debug.html' title='collections::fmt::Debug'>Debug</a>> <a class='trait' href='../../collections/fmt/trait.Debug.html' title='collections::fmt::Debug'>Debug</a> for <a class='struct' href='../../collections/vec/struct.Vec.html' title='collections::vec::Vec'>Vec</a><T></code></h3><div class='impl-items'><h4 id='method.fmt' class='method'><code>fn <a href='../../collections/fmt/trait.Debug.html#method.fmt' class='fnname'>fmt</a>(&self, f: &mut <a class='struct' href='../../collections/fmt/struct.Formatter.html' title='collections::fmt::Formatter'>Formatter</a>) -> <a class='type' href='../../collections/fmt/type.Result.html' title='collections::fmt::Result'>Result</a></code></h4> |
| 1668 |
</div><h3 class='impl'><code>impl<T> <a class='trait' href='../../core/convert/trait.AsRef.html' title='core::convert::AsRef'>AsRef</a><<a class='struct' href='../../collections/vec/struct.Vec.html' title='collections::vec::Vec'>Vec</a><T>> for <a class='struct' href='../../collections/vec/struct.Vec.html' title='collections::vec::Vec'>Vec</a><T></code></h3><div class='impl-items'><h4 id='method.as_ref' class='method'><code>fn <a href='../../core/convert/trait.AsRef.html#method.as_ref' class='fnname'>as_ref</a>(&self) -> &<a class='struct' href='../../collections/vec/struct.Vec.html' title='collections::vec::Vec'>Vec</a><T></code></h4> |
| 1669 |
</div><h3 class='impl'><code>impl<T> <a class='trait' href='../../core/convert/trait.AsRef.html' title='core::convert::AsRef'>AsRef</a><<a href='../primitive.slice.html'>[T]</a>> for <a class='struct' href='../../collections/vec/struct.Vec.html' title='collections::vec::Vec'>Vec</a><T></code></h3><div class='impl-items'><h4 id='method.as_ref' class='method'><code>fn <a href='../../core/convert/trait.AsRef.html#method.as_ref' class='fnname'>as_ref</a>(&self) -> <a href='../primitive.slice.html'>&[T]</a></code></h4> |
| 1670 |
</div><h3 class='impl'><code>impl<'a, T: <a class='trait' href='../../core/clone/trait.Clone.html' title='core::clone::Clone'>Clone</a>> <a class='trait' href='../../core/convert/trait.From.html' title='core::convert::From'>From</a><<a href='../primitive.slice.html'>&'a [T]</a>> for <a class='struct' href='../../collections/vec/struct.Vec.html' title='collections::vec::Vec'>Vec</a><T></code></h3><div class='impl-items'><h4 id='method.from' class='method'><code>fn <a href='../../core/convert/trait.From.html#method.from' class='fnname'>from</a>(s: <a href='../primitive.slice.html'>&'a [T]</a>) -> <a class='struct' href='../../collections/vec/struct.Vec.html' title='collections::vec::Vec'>Vec</a><T></code></h4> |
| 1671 |
</div><h3 class='impl'><code>impl<'a> <a class='trait' href='../../core/convert/trait.From.html' title='core::convert::From'>From</a><&'a <a href='../primitive.str.html'>str</a>> for <a class='struct' href='../../collections/vec/struct.Vec.html' title='collections::vec::Vec'>Vec</a><<a href='../../core/primitive.u8.html'>u8</a>></code></h3><div class='impl-items'><h4 id='method.from' class='method'><code>fn <a href='../../core/convert/trait.From.html#method.from' class='fnname'>from</a>(s: &'a <a href='../primitive.str.html'>str</a>) -> <a class='struct' href='../../collections/vec/struct.Vec.html' title='collections::vec::Vec'>Vec</a><<a href='../../core/primitive.u8.html'>u8</a>></code></h4> |
| 1672 |
</div><h3 class='impl'><code>impl<'a, T: 'a> <a class='trait' href='../../collections/borrow/trait.IntoCow.html' title='collections::borrow::IntoCow'>IntoCow</a><'a, <a href='../primitive.slice.html'>[T]</a>> for <a class='struct' href='../../collections/vec/struct.Vec.html' title='collections::vec::Vec'>Vec</a><T> <span class='where'>where T: <a class='trait' href='../../core/clone/trait.Clone.html' title='core::clone::Clone'>Clone</a></span></code></h3><div class='impl-items'><h4 id='method.into_cow' class='method'><code>fn <a href='../../collections/borrow/trait.IntoCow.html#method.into_cow' class='fnname'>into_cow</a>(self) -> <a class='enum' href='../../collections/borrow/enum.Cow.html' title='collections::borrow::Cow'>Cow</a><'a, <a href='../primitive.slice.html'>[T]</a>></code></h4> |
| 1673 |
</div></section> |
| 1674 |
<section id='search' class="content hidden"></section> |
| 1675 |
|
| 1676 |
<section class="footer"></section> |
| 1677 |
|
| 1678 |
<div id="help" class="hidden"> |
| 1679 |
<div class="shortcuts"> |
| 1680 |
<h1>Keyboard shortcuts</h1> |
| 1681 |
<dl> |
| 1682 |
<dt>?</dt> |
| 1683 |
<dd>Show this help dialog</dd> |
| 1684 |
<dt>S</dt> |
| 1685 |
<dd>Focus the search field</dd> |
| 1686 |
<dt>⇤</dt> |
| 1687 |
<dd>Move up in search results</dd> |
| 1688 |
<dt>⇥</dt> |
| 1689 |
<dd>Move down in search results</dd> |
| 1690 |
<dt>⏎</dt> |
| 1691 |
<dd>Go to active search result</dd> |
| 1692 |
</dl> |
| 1693 |
</div> |
| 1694 |
<div class="infos"> |
| 1695 |
<h1>Search tricks</h1> |
| 1696 |
<p> |
| 1697 |
Prefix searches with a type followed by a colon (e.g. |
| 1698 |
<code>fn:</code>) to restrict the search to a given type. |
| 1699 |
</p> |
| 1700 |
<p> |
| 1701 |
Accepted types are: <code>fn</code>, <code>mod</code>, |
| 1702 |
<code>struct</code>, <code>enum</code>, |
| 1703 |
<code>trait</code>, <code>typedef</code> (or |
| 1704 |
<code>tdef</code>). |
| 1705 |
</p> |
| 1706 |
<p> |
| 1707 |
Search functions by type signature (e.g. |
| 1708 |
<code>vec -> usize</code>) |
| 1709 |
</p> |
| 1710 |
</div> |
| 1711 |
</div> |
| 1712 |
|
| 1713 |
|
| 1714 |
|
| 1715 |
<script> |
| 1716 |
window.rootPath = "../../"; |
| 1717 |
window.currentCrate = "collections"; |
| 1718 |
window.playgroundUrl = "http://play.rust-lang.org/"; |
| 1719 |
</script> |
| 1720 |
<script src="../../jquery.js"></script> |
| 1721 |
<script src="../../main.js"></script> |
| 1722 |
<script src="../../playpen.js"></script> |
| 1723 |
<script async src="../../search-index.js"></script> |
| 1724 |
</body> |
| 1725 |
</html> |