diff --git a/hyper/client/struct.ProxyConfig.html b/hyper/client/struct.ProxyConfig.html index 5da0d654..a60f1854 100644 --- a/hyper/client/struct.ProxyConfig.html +++ b/hyper/client/struct.ProxyConfig.html @@ -48,7 +48,7 @@ [−] [src] -
pub struct ProxyConfig<H, S> where H: Into<Cow<'static, str>>, S: SslClient<HttpConnector::Stream> + Send + Sync + 'static(pub H, pub u16, pub S);
Proxy server configuration with a custom TLS wrapper.
+pub struct ProxyConfig<H, S>(pub H, pub u16, pub S) where H: Into<Cow<'static, str>>, S: SslClient<HttpConnector::Stream> + Send + Sync + 'static;
Proxy server configuration with a custom TLS wrapper.
fn description(&self) -> &str
A short description of the error. Read more
fn cause(&self) -> Option<&StdError>
The lower-level cause of this error, if any.
+The lower-level cause of this error, if any. Read more
impl From<IoError> for Error
[src]fn from(err: IoError) -> Error
Performs the conversion.
diff --git a/hyper/net/struct.HttpsConnector.html b/hyper/net/struct.HttpsConnector.html index 9bc6f148..07d0462d 100644 --- a/hyper/net/struct.HttpsConnector.html +++ b/hyper/net/struct.HttpsConnector.html @@ -66,7 +66,7 @@impl<S: SslClient, C: NetworkConnector<Stream=HttpStream>> NetworkConnector for HttpsConnector<S, C>
[src]type Stream = HttpsStream<S::Stream>
Type of Stream
to create
fn connect(&self, host: &str, port: u16, scheme: &str) -> Result<Self::Stream>
fn connect(&self, host: &str, port: u16, scheme: &str) -> Result<Self::Stream>
Connect to a remote address.
impl Ssl for Openssl
[src]type Stream = SslStream<HttpStream>
The protected stream.
-fn wrap_client(&self, stream: HttpStream, host: &str) -> Result<Self::Stream>
fn wrap_client(&self, stream: HttpStream, host: &str) -> Result<Self::Stream>
Wrap a client stream with SSL.
-fn wrap_server(&self, stream: HttpStream) -> Result<Self::Stream>
fn wrap_server(&self, stream: HttpStream) -> Result<Self::Stream>
Wrap a server stream with SSL.
impl<T: NetworkStream + Send + Clone> SslClient<T> for OpensslClient
[src]type Stream = SslStream<T>
The protected stream.
-fn wrap_client(&self, stream: T, host: &str) -> Result<Self::Stream>
fn wrap_client(&self, stream: T, host: &str) -> Result<Self::Stream>
Wrap a client stream with SSL.
pub trait NetworkConnector { type Stream: Into<Box<NetworkStream + Send>>; - fn connect(&self, host: &str, port: u16, scheme: &str) -> Result<Self::Stream>; + fn connect(&self, host: &str, port: u16, scheme: &str) -> Result<Self::Stream>; }
A connector creates a NetworkStream.
fn connect(&self, host: &str, port: u16, scheme: &str) -> Result<Self::Stream>
Connect to a remote address.
+fn connect(&self, host: &str, port: u16, scheme: &str) -> Result<Self::Stream>
Connect to a remote address.
pub trait NetworkListener: Clone { type Stream: NetworkStream + Send + Clone; - fn accept(&mut self) -> Result<Self::Stream>; + fn accept(&mut self) -> Result<Self::Stream>; fn local_addr(&mut self) -> Result<SocketAddr>; fn incoming(&mut self) -> NetworkConnections<Self> { ... } @@ -62,7 +62,7 @@
fn accept(&mut self) -> Result<Self::Stream>
Returns an iterator of streams.
+fn accept(&mut self) -> Result<Self::Stream>
Returns an iterator of streams.
fn local_addr(&mut self) -> Result<SocketAddr>
Get the address this Listener ended up listening on.
pub trait Ssl { type Stream: NetworkStream + Send + Clone; - fn wrap_client(&self, stream: HttpStream, host: &str) -> Result<Self::Stream>; - fn wrap_server(&self, stream: HttpStream) -> Result<Self::Stream>; + fn wrap_client(&self, stream: HttpStream, host: &str) -> Result<Self::Stream>; + fn wrap_server(&self, stream: HttpStream) -> Result<Self::Stream>; }
Deprecated
Use SslClient
and SslServer
instead.
fn wrap_client(&self, stream: HttpStream, host: &str) -> Result<Self::Stream>
Wrap a client stream with SSL.
-fn wrap_server(&self, stream: HttpStream) -> Result<Self::Stream>
Wrap a server stream with SSL.
+fn wrap_client(&self, stream: HttpStream, host: &str) -> Result<Self::Stream>
Wrap a client stream with SSL.
+fn wrap_server(&self, stream: HttpStream) -> Result<Self::Stream>
Wrap a server stream with SSL.
pub trait SslClient<T: NetworkStream + Send + Clone = HttpStream> { type Stream: NetworkStream + Send + Clone; - fn wrap_client(&self, stream: T, host: &str) -> Result<Self::Stream>; + fn wrap_client(&self, stream: T, host: &str) -> Result<Self::Stream>; }
An abstraction to allow any SSL implementation to be used with client-side HttpsStreams.
fn wrap_client(&self, stream: T, host: &str) -> Result<Self::Stream>
Wrap a client stream with SSL.
+fn wrap_client(&self, stream: T, host: &str) -> Result<Self::Stream>
Wrap a client stream with SSL.
pub trait SslServer<T: NetworkStream + Send + Clone = HttpStream> { type Stream: NetworkStream + Send + Clone; - fn wrap_server(&self, stream: T) -> Result<Self::Stream>; + fn wrap_server(&self, stream: T) -> Result<Self::Stream>; }
An abstraction to allow any SSL implementation to be used with server-side HttpsStreams.
fn wrap_server(&self, stream: T) -> Result<Self::Stream>
Wrap a server stream with SSL.
+fn wrap_server(&self, stream: T) -> Result<Self::Stream>
Wrap a server stream with SSL.
fn origin(&self) -> Origin
Return the origin of this URL (https://url.spec.whatwg.org/#origin)
-Note: this return an opaque origin for file:
URLs, which causes
+
Note: this returns an opaque origin for file:
URLs, which causes
url.origin() != url.origin()
.
fn scheme(&self) -> &str
Return the scheme of this URL, lower-cased, as an ASCII string without the ':' delimiter.
+ ++use url::Url; + +let url = Url::parse("file:///tmp/foo").unwrap(); +assert_eq!(url.scheme(), "file");
fn has_authority(&self) -> bool
Return whether the URL has an 'authority', which can contain a username, password, host, and port number.
@@ -131,17 +138,36 @@ as is typically the case ofdata:
and mailto:
URLs.Return the username for this URL (typically the empty string) as a percent-encoded ASCII string.
-use url::Url; let url = Url::parse("ftp://rms@example.com").unwrap(); assert_eq!(url.username(), "rms"); +let url = Url::parse("ftp://:secret123@example.com").unwrap(); +assert_eq!(url.username(), ""); + let url = Url::parse("https://example.com").unwrap(); assert_eq!(url.username(), "");
fn password(&self) -> Option<&str>
Return the password for this URL, if any, as a percent-encoded ASCII string.
+ ++use url::Url; + +let url = Url::parse("ftp://rms:secret123@example.com").unwrap(); +assert_eq!(url.password(), Some("secret123")); + +let url = Url::parse("ftp://:secret123@example.com").unwrap(); +assert_eq!(url.password(), Some("secret123")); + +let url = Url::parse("ftp://rms@example.com").unwrap(); +assert_eq!(url.password(), None); + +let url = Url::parse("https://example.com").unwrap(); +assert_eq!(url.password(), None);
fn has_host(&self) -> bool
Equivalent to url.host().is_some()
.
fn host_str(&self) -> Option<&str>
fn description(&self) -> &str
A short description of the error. Read more
fn cause(&self) -> Option<&Error>
The lower-level cause of this error, if any.
+The lower-level cause of this error, if any. Read more
impl From<Error> for Error
impl From<ParseError> for Error
fn description(&self) -> &str
A short description of the error. Read more
fn cause(&self) -> Option<&StdError>
The lower-level cause of this error, if any.
+The lower-level cause of this error, if any. Read more
1
and 0
.
Cookie
header, defined in RFC6265
Cookie
header, defined in RFC6265
Note that this will drop any excess capacity. Calling this and
converting back to a vector with into_vec()
is equivalent to calling
shrink_to_fit()
.
+let v = vec![1, 2, 3]; + +let slice = v.into_boxed_slice();+ +
Any excess capacity is removed:
+ ++let mut vec = Vec::with_capacity(10); +vec.extend([1, 2, 3].iter().cloned()); + +assert_eq!(vec.capacity(), 10); +let slice = vec.into_boxed_slice(); +assert_eq!(slice.into_vec().capacity(), 3);
fn truncate(&mut self, len: usize)
Shorten a vector to be len
elements long, dropping excess elements.
Shortens the vector, keeping the first len
elements and dropping
+the rest.
If len
is greater than the vector's current length, this has no
effect.
The drain
method can emulate truncate
, but causes the excess
+elements to be returned instead of dropped.
Truncating a five element vector to two elements:
+let mut vec = vec![1, 2, 3, 4, 5]; vec.truncate(2); assert_eq!(vec, [1, 2]);+ +
No truncation occurs when len
is greater than the vector's current
+length:
+let mut vec = vec![1, 2, 3]; +vec.truncate(8); +assert_eq!(vec, [1, 2, 3]);+ +
Truncating when len == 0
is equivalent to calling the clear
+method.
+let mut vec = vec![1, 2, 3]; +vec.truncate(0); +assert_eq!(vec, []);
fn as_slice(&self) -> &[T]
Extracts a slice containing the entire vector.
Equivalent to &s[..]
.
+use std::io::{self, Write}; +let buffer = vec![1, 2, 3, 5, 8]; +io::sink().write(buffer.as_slice()).unwrap();
fn as_mut_slice(&mut self) -> &mut [T]
Extracts a mutable slice of the entire vector.
Equivalent to &mut s[..]
.
+use std::io::{self, Read}; +let mut buffer = vec![0; 3]; +io::repeat(0b101).read_exact(buffer.as_mut_slice()).unwrap();
unsafe fn set_len(&mut self, len: usize)
Sets the length of a vector.
@@ -206,11 +256,38 @@ effect. modifying its buffers, so it is up to the caller to ensure that the vector is actually the specified size. --let mut v = vec![1, 2, 3, 4]; +use std::ptr; + +let mut vec = vec!['r', 'u', 's', 't']; + unsafe { - v.set_len(1); + ptr::drop_in_place(&mut vec[3]); + vec.set_len(3); +} +assert_eq!(vec, ['r', 'u', 's']);+ +
In this example, there is a memory leak since the memory locations
+owned by the inner vectors were not freed prior to the set_len
call:
+let mut vec = vec![vec![1, 0, 0], + vec![0, 1, 0], + vec![0, 0, 1]]; +unsafe { + vec.set_len(0); +}+ +
In this example, the vector gets expanded from zero to four items +without any memory allocations occurring, resulting in vector +values of unallocated memory:
+ ++let mut vec: Vec<char> = Vec::new(); + +unsafe { + vec.set_len(4); }
fn swap_remove(&mut self, index: usize) -> T
Removes an element from anywhere in the vector and return it, replacing @@ -221,7 +298,7 @@ it with the last element.
Panics if index
is out of bounds.
let mut v = vec!["foo", "bar", "baz", "qux"]; @@ -237,7 +314,7 @@ elements after it to the right.Panics
Panics if
-index
is greater than the vector's length.Examples
+Examples
let mut vec = vec![1, 2, 3]; vec.insert(1, 4); @@ -251,7 +328,7 @@ shifting all elements after it to the left.Panics
Panics if
-index
is out of bounds.Examples
+Examples
let mut v = vec![1, 2, 3]; assert_eq!(v.remove(1), 2); @@ -263,7 +340,7 @@ shifting all elements after it to the left. This method operates in place and preserves the order of the retained elements. -Examples
+Examples
let mut vec = vec![1, 2, 3, 4]; vec.retain(|&x| x%2 == 0); @@ -274,7 +351,7 @@ elements.Panics
Panics if the number of elements in the vector overflows a
-usize
.Examples
+Examples
let mut vec = vec![1, 2]; vec.push(3); @@ -283,7 +360,7 @@ elements.Removes the last element from a vector and returns it, or
-None
if it is empty.Examples
+Examples
let mut vec = vec![1, 2, 3]; assert_eq!(vec.pop(), Some(3)); @@ -294,7 +371,7 @@ is empty.Panics
Panics if the number of elements in the vector overflows a
-usize
.Examples
+Examples
let mut vec = vec![1, 2, 3]; let mut vec2 = vec![4, 5, 6]; @@ -315,7 +392,7 @@ if theDrain
value is leaked.Panics if the starting point is greater than the end point or if the end point is greater than the length of the vector.
-Examples
+Examples
let mut v = vec![1, 2, 3]; let u: Vec<_> = v.drain(1..).collect(); @@ -328,7 +405,7 @@ the end point is greater than the length of the vector.
fn clear(&mut self)
1.0.0Clears the vector, removing all values.
-Examples
+Examples
let mut v = vec![1, 2, 3]; @@ -338,14 +415,14 @@ the end point is greater than the length of the vector.
fn len(&self) -> usize
1.0.0Returns the number of elements in the vector.
-Examples
+Examples
let a = vec![1, 2, 3]; assert_eq!(a.len(), 3);
fn is_empty(&self) -> bool
1.0.0Returns
-true
if the vector contains no elements.Examples
+Examples
let mut v = Vec::new(); assert!(v.is_empty()); @@ -363,7 +440,7 @@ and the returnedSelf
contains elements[at, len)
.Panics
Panics if
-at > len
.Examples
+Examples
let mut vec = vec![1,2,3]; let vec2 = vec.split_off(1); @@ -376,7 +453,7 @@ and the returnedSelf
contains elements[at, len)
. difference, with each additional slot filled withvalue
. Ifnew_len
is less thanlen()
, theVec
is simply truncated. -Examples
+Examples
let mut vec = vec!["hello"]; vec.resize(3, "world"); @@ -396,7 +473,7 @@ specialized to work with slices instead. If and when Rust gets specialization this function will likely be deprecated (but still available). -Examples
+Examples
let mut vec = vec![1]; vec.extend_from_slice(&[2, 3, 4]); @@ -406,7 +483,7 @@ available).If the vector is sorted, this removes all duplicates.
-Examples
+Examples
let mut vec = vec![1, 2, 2, 3, 2]; diff --git a/iron/headers/struct.AcceptCharset.html b/iron/headers/struct.AcceptCharset.html index cfe2f6a0..8bfc70e3 100644 --- a/iron/headers/struct.AcceptCharset.html +++ b/iron/headers/struct.AcceptCharset.html @@ -151,25 +151,75 @@ may still inform the vector that there is space for a few more elements.Note that this will drop any excess capacity. Calling this and converting back to a vector with
+ +into_vec()
is equivalent to callingshrink_to_fit()
.Examples
++let v = vec![1, 2, 3]; + +let slice = v.into_boxed_slice();+ +Any excess capacity is removed:
+ ++let mut vec = Vec::with_capacity(10); +vec.extend([1, 2, 3].iter().cloned()); + +assert_eq!(vec.capacity(), 10); +let slice = vec.into_boxed_slice(); +assert_eq!(slice.into_vec().capacity(), 3);-
fn truncate(&mut self, len: usize)
1.0.0Shorten a vector to be
+len
elements long, dropping excess elements.Shortens the vector, keeping the first
len
elements and dropping +the rest.If
-len
is greater than the vector's current length, this has no effect.Examples
+The
+ +drain
method can emulatetruncate
, but causes the excess +elements to be returned instead of dropped.Examples
+Truncating a five element vector to two elements:
+let mut vec = vec![1, 2, 3, 4, 5]; vec.truncate(2); assert_eq!(vec, [1, 2]);+ +No truncation occurs when
+ +len
is greater than the vector's current +length:+let mut vec = vec![1, 2, 3]; +vec.truncate(8); +assert_eq!(vec, [1, 2, 3]);+ +Truncating when
+ +len == 0
is equivalent to calling theclear
+method.+let mut vec = vec![1, 2, 3]; +vec.truncate(0); +assert_eq!(vec, []);
fn as_slice(&self) -> &[T]
1.7.0Extracts a slice containing the entire vector.
Equivalent to
+ +&s[..]
.Examples
++use std::io::{self, Write}; +let buffer = vec![1, 2, 3, 5, 8]; +io::sink().write(buffer.as_slice()).unwrap();
fn as_mut_slice(&mut self) -> &mut [T]
1.7.0Extracts a mutable slice of the entire vector.
Equivalent to
+ +&mut s[..]
.Examples
++use std::io::{self, Read}; +let mut buffer = vec![0; 3]; +io::repeat(0b101).read_exact(buffer.as_mut_slice()).unwrap();
unsafe fn set_len(&mut self, len: usize)
1.0.0Sets the length of a vector.
@@ -177,11 +227,38 @@ effect. modifying its buffers, so it is up to the caller to ensure that the vector is actually the specified size. -Examples
+Examples
-let mut v = vec![1, 2, 3, 4]; +use std::ptr; + +let mut vec = vec!['r', 'u', 's', 't']; + unsafe { - v.set_len(1); + ptr::drop_in_place(&mut vec[3]); + vec.set_len(3); +} +assert_eq!(vec, ['r', 'u', 's']);+ +In this example, there is a memory leak since the memory locations +owned by the inner vectors were not freed prior to the
+ +set_len
call:+let mut vec = vec![vec![1, 0, 0], + vec![0, 1, 0], + vec![0, 0, 1]]; +unsafe { + vec.set_len(0); +}+ +In this example, the vector gets expanded from zero to four items +without any memory allocations occurring, resulting in vector +values of unallocated memory:
+ ++let mut vec: Vec<char> = Vec::new(); + +unsafe { + vec.set_len(4); }
fn swap_remove(&mut self, index: usize) -> T
1.0.0Removes an element from anywhere in the vector and return it, replacing @@ -192,7 +269,7 @@ it with the last element.
Panics
Panics if
-index
is out of bounds.Examples
+Examples
let mut v = vec!["foo", "bar", "baz", "qux"]; @@ -208,7 +285,7 @@ elements after it to the right.Panics
Panics if
-index
is greater than the vector's length.Examples
+Examples
let mut vec = vec![1, 2, 3]; vec.insert(1, 4); @@ -222,7 +299,7 @@ shifting all elements after it to the left.Panics
Panics if
-index
is out of bounds.Examples
+Examples
let mut v = vec![1, 2, 3]; assert_eq!(v.remove(1), 2); @@ -234,7 +311,7 @@ shifting all elements after it to the left. This method operates in place and preserves the order of the retained elements. -Examples
+Examples
let mut vec = vec![1, 2, 3, 4]; vec.retain(|&x| x%2 == 0); @@ -245,7 +322,7 @@ elements.Panics
Panics if the number of elements in the vector overflows a
-usize
.Examples
+Examples
let mut vec = vec![1, 2]; vec.push(3); @@ -254,7 +331,7 @@ elements.Removes the last element from a vector and returns it, or
-None
if it is empty.Examples
+Examples
let mut vec = vec![1, 2, 3]; assert_eq!(vec.pop(), Some(3)); @@ -265,7 +342,7 @@ is empty.Panics
Panics if the number of elements in the vector overflows a
-usize
.Examples
+Examples
let mut vec = vec![1, 2, 3]; let mut vec2 = vec![4, 5, 6]; @@ -286,7 +363,7 @@ if theDrain
value is leaked.Panics if the starting point is greater than the end point or if the end point is greater than the length of the vector.
-Examples
+Examples
let mut v = vec![1, 2, 3]; let u: Vec<_> = v.drain(1..).collect(); @@ -299,7 +376,7 @@ the end point is greater than the length of the vector.
fn clear(&mut self)
1.0.0Clears the vector, removing all values.
-Examples
+Examples
let mut v = vec![1, 2, 3]; @@ -309,14 +386,14 @@ the end point is greater than the length of the vector.
fn len(&self) -> usize
1.0.0Returns the number of elements in the vector.
-Examples
+Examples
let a = vec![1, 2, 3]; assert_eq!(a.len(), 3);
fn is_empty(&self) -> bool
1.0.0Returns
-true
if the vector contains no elements.Examples
+Examples
let mut v = Vec::new(); assert!(v.is_empty()); @@ -334,7 +411,7 @@ and the returnedSelf
contains elements[at, len)
.Panics
Panics if
-at > len
.Examples
+Examples
let mut vec = vec![1,2,3]; let vec2 = vec.split_off(1); @@ -347,7 +424,7 @@ and the returnedSelf
contains elements[at, len)
. difference, with each additional slot filled withvalue
. Ifnew_len
is less thanlen()
, theVec
is simply truncated. -Examples
+Examples
let mut vec = vec!["hello"]; vec.resize(3, "world"); @@ -367,7 +444,7 @@ specialized to work with slices instead. If and when Rust gets specialization this function will likely be deprecated (but still available). -Examples
+Examples
let mut vec = vec![1]; vec.extend_from_slice(&[2, 3, 4]); @@ -377,7 +454,7 @@ available).If the vector is sorted, this removes all duplicates.
-Examples
+Examples
let mut vec = vec![1, 2, 2, 3, 2]; diff --git a/iron/headers/struct.AcceptEncoding.html b/iron/headers/struct.AcceptEncoding.html index a9676bfe..9f67f3d5 100644 --- a/iron/headers/struct.AcceptEncoding.html +++ b/iron/headers/struct.AcceptEncoding.html @@ -160,25 +160,75 @@ may still inform the vector that there is space for a few more elements.Note that this will drop any excess capacity. Calling this and converting back to a vector with
+ +into_vec()
is equivalent to callingshrink_to_fit()
.Examples
++let v = vec![1, 2, 3]; + +let slice = v.into_boxed_slice();+ +Any excess capacity is removed:
+ ++let mut vec = Vec::with_capacity(10); +vec.extend([1, 2, 3].iter().cloned()); + +assert_eq!(vec.capacity(), 10); +let slice = vec.into_boxed_slice(); +assert_eq!(slice.into_vec().capacity(), 3);-
fn truncate(&mut self, len: usize)
1.0.0Shorten a vector to be
+len
elements long, dropping excess elements.Shortens the vector, keeping the first
len
elements and dropping +the rest.If
-len
is greater than the vector's current length, this has no effect.Examples
+The
+ +drain
method can emulatetruncate
, but causes the excess +elements to be returned instead of dropped.Examples
+Truncating a five element vector to two elements:
+let mut vec = vec![1, 2, 3, 4, 5]; vec.truncate(2); assert_eq!(vec, [1, 2]);+ +No truncation occurs when
+ +len
is greater than the vector's current +length:+let mut vec = vec![1, 2, 3]; +vec.truncate(8); +assert_eq!(vec, [1, 2, 3]);+ +Truncating when
+ +len == 0
is equivalent to calling theclear
+method.+let mut vec = vec![1, 2, 3]; +vec.truncate(0); +assert_eq!(vec, []);
fn as_slice(&self) -> &[T]
1.7.0Extracts a slice containing the entire vector.
Equivalent to
+ +&s[..]
.Examples
++use std::io::{self, Write}; +let buffer = vec![1, 2, 3, 5, 8]; +io::sink().write(buffer.as_slice()).unwrap();
fn as_mut_slice(&mut self) -> &mut [T]
1.7.0Extracts a mutable slice of the entire vector.
Equivalent to
+ +&mut s[..]
.Examples
++use std::io::{self, Read}; +let mut buffer = vec![0; 3]; +io::repeat(0b101).read_exact(buffer.as_mut_slice()).unwrap();
unsafe fn set_len(&mut self, len: usize)
1.0.0Sets the length of a vector.
@@ -186,11 +236,38 @@ effect. modifying its buffers, so it is up to the caller to ensure that the vector is actually the specified size. -Examples
+Examples
-let mut v = vec![1, 2, 3, 4]; +use std::ptr; + +let mut vec = vec!['r', 'u', 's', 't']; + unsafe { - v.set_len(1); + ptr::drop_in_place(&mut vec[3]); + vec.set_len(3); +} +assert_eq!(vec, ['r', 'u', 's']);+ +In this example, there is a memory leak since the memory locations +owned by the inner vectors were not freed prior to the
+ +set_len
call:+let mut vec = vec![vec![1, 0, 0], + vec![0, 1, 0], + vec![0, 0, 1]]; +unsafe { + vec.set_len(0); +}+ +In this example, the vector gets expanded from zero to four items +without any memory allocations occurring, resulting in vector +values of unallocated memory:
+ ++let mut vec: Vec<char> = Vec::new(); + +unsafe { + vec.set_len(4); }
fn swap_remove(&mut self, index: usize) -> T
1.0.0Removes an element from anywhere in the vector and return it, replacing @@ -201,7 +278,7 @@ it with the last element.
Panics
Panics if
-index
is out of bounds.Examples
+Examples
let mut v = vec!["foo", "bar", "baz", "qux"]; @@ -217,7 +294,7 @@ elements after it to the right.Panics
Panics if
-index
is greater than the vector's length.Examples
+Examples
let mut vec = vec![1, 2, 3]; vec.insert(1, 4); @@ -231,7 +308,7 @@ shifting all elements after it to the left.Panics
Panics if
-index
is out of bounds.Examples
+Examples
let mut v = vec![1, 2, 3]; assert_eq!(v.remove(1), 2); @@ -243,7 +320,7 @@ shifting all elements after it to the left. This method operates in place and preserves the order of the retained elements. -Examples
+Examples
let mut vec = vec![1, 2, 3, 4]; vec.retain(|&x| x%2 == 0); @@ -254,7 +331,7 @@ elements.Panics
Panics if the number of elements in the vector overflows a
-usize
.Examples
+Examples
let mut vec = vec![1, 2]; vec.push(3); @@ -263,7 +340,7 @@ elements.Removes the last element from a vector and returns it, or
-None
if it is empty.Examples
+Examples
let mut vec = vec![1, 2, 3]; assert_eq!(vec.pop(), Some(3)); @@ -274,7 +351,7 @@ is empty.Panics
Panics if the number of elements in the vector overflows a
-usize
.Examples
+Examples
let mut vec = vec![1, 2, 3]; let mut vec2 = vec![4, 5, 6]; @@ -295,7 +372,7 @@ if theDrain
value is leaked.Panics if the starting point is greater than the end point or if the end point is greater than the length of the vector.
-Examples
+Examples
let mut v = vec![1, 2, 3]; let u: Vec<_> = v.drain(1..).collect(); @@ -308,7 +385,7 @@ the end point is greater than the length of the vector.
fn clear(&mut self)
1.0.0Clears the vector, removing all values.
-Examples
+Examples
let mut v = vec![1, 2, 3]; @@ -318,14 +395,14 @@ the end point is greater than the length of the vector.
fn len(&self) -> usize
1.0.0Returns the number of elements in the vector.
-Examples
+Examples
let a = vec![1, 2, 3]; assert_eq!(a.len(), 3);
fn is_empty(&self) -> bool
1.0.0Returns
-true
if the vector contains no elements.Examples
+Examples
let mut v = Vec::new(); assert!(v.is_empty()); @@ -343,7 +420,7 @@ and the returnedSelf
contains elements[at, len)
.Panics
Panics if
-at > len
.Examples
+Examples
let mut vec = vec![1,2,3]; let vec2 = vec.split_off(1); @@ -356,7 +433,7 @@ and the returnedSelf
contains elements[at, len)
. difference, with each additional slot filled withvalue
. Ifnew_len
is less thanlen()
, theVec
is simply truncated. -Examples
+Examples
let mut vec = vec!["hello"]; vec.resize(3, "world"); @@ -376,7 +453,7 @@ specialized to work with slices instead. If and when Rust gets specialization this function will likely be deprecated (but still available). -Examples
+Examples
let mut vec = vec![1]; vec.extend_from_slice(&[2, 3, 4]); @@ -386,7 +463,7 @@ available).If the vector is sorted, this removes all duplicates.
-Examples
+Examples
let mut vec = vec![1, 2, 2, 3, 2]; diff --git a/iron/headers/struct.AcceptLanguage.html b/iron/headers/struct.AcceptLanguage.html index 2b99ea06..aa6b3299 100644 --- a/iron/headers/struct.AcceptLanguage.html +++ b/iron/headers/struct.AcceptLanguage.html @@ -147,25 +147,75 @@ may still inform the vector that there is space for a few more elements.Note that this will drop any excess capacity. Calling this and converting back to a vector with
+ +into_vec()
is equivalent to callingshrink_to_fit()
.Examples
++let v = vec![1, 2, 3]; + +let slice = v.into_boxed_slice();+ +Any excess capacity is removed:
+ ++let mut vec = Vec::with_capacity(10); +vec.extend([1, 2, 3].iter().cloned()); + +assert_eq!(vec.capacity(), 10); +let slice = vec.into_boxed_slice(); +assert_eq!(slice.into_vec().capacity(), 3);-
fn truncate(&mut self, len: usize)
1.0.0Shorten a vector to be
+len
elements long, dropping excess elements.Shortens the vector, keeping the first
len
elements and dropping +the rest.If
-len
is greater than the vector's current length, this has no effect.Examples
+The
+ +drain
method can emulatetruncate
, but causes the excess +elements to be returned instead of dropped.Examples
+Truncating a five element vector to two elements:
+let mut vec = vec![1, 2, 3, 4, 5]; vec.truncate(2); assert_eq!(vec, [1, 2]);+ +No truncation occurs when
+ +len
is greater than the vector's current +length:+let mut vec = vec![1, 2, 3]; +vec.truncate(8); +assert_eq!(vec, [1, 2, 3]);+ +Truncating when
+ +len == 0
is equivalent to calling theclear
+method.+let mut vec = vec![1, 2, 3]; +vec.truncate(0); +assert_eq!(vec, []);
fn as_slice(&self) -> &[T]
1.7.0Extracts a slice containing the entire vector.
Equivalent to
+ +&s[..]
.Examples
++use std::io::{self, Write}; +let buffer = vec![1, 2, 3, 5, 8]; +io::sink().write(buffer.as_slice()).unwrap();
fn as_mut_slice(&mut self) -> &mut [T]
1.7.0Extracts a mutable slice of the entire vector.
Equivalent to
+ +&mut s[..]
.Examples
++use std::io::{self, Read}; +let mut buffer = vec![0; 3]; +io::repeat(0b101).read_exact(buffer.as_mut_slice()).unwrap();
unsafe fn set_len(&mut self, len: usize)
1.0.0Sets the length of a vector.
@@ -173,11 +223,38 @@ effect. modifying its buffers, so it is up to the caller to ensure that the vector is actually the specified size. -Examples
+Examples
-let mut v = vec![1, 2, 3, 4]; +use std::ptr; + +let mut vec = vec!['r', 'u', 's', 't']; + unsafe { - v.set_len(1); + ptr::drop_in_place(&mut vec[3]); + vec.set_len(3); +} +assert_eq!(vec, ['r', 'u', 's']);+ +In this example, there is a memory leak since the memory locations +owned by the inner vectors were not freed prior to the
+ +set_len
call:+let mut vec = vec![vec![1, 0, 0], + vec![0, 1, 0], + vec![0, 0, 1]]; +unsafe { + vec.set_len(0); +}+ +In this example, the vector gets expanded from zero to four items +without any memory allocations occurring, resulting in vector +values of unallocated memory:
+ ++let mut vec: Vec<char> = Vec::new(); + +unsafe { + vec.set_len(4); }
fn swap_remove(&mut self, index: usize) -> T
1.0.0Removes an element from anywhere in the vector and return it, replacing @@ -188,7 +265,7 @@ it with the last element.
Panics
Panics if
-index
is out of bounds.Examples
+Examples
let mut v = vec!["foo", "bar", "baz", "qux"]; @@ -204,7 +281,7 @@ elements after it to the right.Panics
Panics if
-index
is greater than the vector's length.Examples
+Examples
let mut vec = vec![1, 2, 3]; vec.insert(1, 4); @@ -218,7 +295,7 @@ shifting all elements after it to the left.Panics
Panics if
-index
is out of bounds.Examples
+Examples
let mut v = vec![1, 2, 3]; assert_eq!(v.remove(1), 2); @@ -230,7 +307,7 @@ shifting all elements after it to the left. This method operates in place and preserves the order of the retained elements. -Examples
+Examples
let mut vec = vec![1, 2, 3, 4]; vec.retain(|&x| x%2 == 0); @@ -241,7 +318,7 @@ elements.Panics
Panics if the number of elements in the vector overflows a
-usize
.Examples
+Examples
let mut vec = vec![1, 2]; vec.push(3); @@ -250,7 +327,7 @@ elements.Removes the last element from a vector and returns it, or
-None
if it is empty.Examples
+Examples
let mut vec = vec![1, 2, 3]; assert_eq!(vec.pop(), Some(3)); @@ -261,7 +338,7 @@ is empty.Panics
Panics if the number of elements in the vector overflows a
-usize
.Examples
+Examples
let mut vec = vec![1, 2, 3]; let mut vec2 = vec![4, 5, 6]; @@ -282,7 +359,7 @@ if theDrain
value is leaked.Panics if the starting point is greater than the end point or if the end point is greater than the length of the vector.
-Examples
+Examples
let mut v = vec![1, 2, 3]; let u: Vec<_> = v.drain(1..).collect(); @@ -295,7 +372,7 @@ the end point is greater than the length of the vector.
fn clear(&mut self)
1.0.0Clears the vector, removing all values.
-Examples
+Examples
let mut v = vec![1, 2, 3]; @@ -305,14 +382,14 @@ the end point is greater than the length of the vector.
fn len(&self) -> usize
1.0.0Returns the number of elements in the vector.
-Examples
+Examples
let a = vec![1, 2, 3]; assert_eq!(a.len(), 3);
fn is_empty(&self) -> bool
1.0.0Returns
-true
if the vector contains no elements.Examples
+Examples
let mut v = Vec::new(); assert!(v.is_empty()); @@ -330,7 +407,7 @@ and the returnedSelf
contains elements[at, len)
.Panics
Panics if
-at > len
.Examples
+Examples
let mut vec = vec![1,2,3]; let vec2 = vec.split_off(1); @@ -343,7 +420,7 @@ and the returnedSelf
contains elements[at, len)
. difference, with each additional slot filled withvalue
. Ifnew_len
is less thanlen()
, theVec
is simply truncated. -Examples
+Examples
let mut vec = vec!["hello"]; vec.resize(3, "world"); @@ -363,7 +440,7 @@ specialized to work with slices instead. If and when Rust gets specialization this function will likely be deprecated (but still available). -Examples
+Examples
let mut vec = vec![1]; vec.extend_from_slice(&[2, 3, 4]); @@ -373,7 +450,7 @@ available).If the vector is sorted, this removes all duplicates.
-Examples
+Examples
let mut vec = vec![1, 2, 2, 3, 2]; diff --git a/iron/headers/struct.AcceptRanges.html b/iron/headers/struct.AcceptRanges.html index 25cc9268..0f3eb8ac 100644 --- a/iron/headers/struct.AcceptRanges.html +++ b/iron/headers/struct.AcceptRanges.html @@ -146,25 +146,75 @@ may still inform the vector that there is space for a few more elements.Note that this will drop any excess capacity. Calling this and converting back to a vector with
+ +into_vec()
is equivalent to callingshrink_to_fit()
.Examples
++let v = vec![1, 2, 3]; + +let slice = v.into_boxed_slice();+ +Any excess capacity is removed:
+ ++let mut vec = Vec::with_capacity(10); +vec.extend([1, 2, 3].iter().cloned()); + +assert_eq!(vec.capacity(), 10); +let slice = vec.into_boxed_slice(); +assert_eq!(slice.into_vec().capacity(), 3);-
fn truncate(&mut self, len: usize)
1.0.0Shorten a vector to be
+len
elements long, dropping excess elements.Shortens the vector, keeping the first
len
elements and dropping +the rest.If
-len
is greater than the vector's current length, this has no effect.Examples
+The
+ +drain
method can emulatetruncate
, but causes the excess +elements to be returned instead of dropped.Examples
+Truncating a five element vector to two elements:
+let mut vec = vec![1, 2, 3, 4, 5]; vec.truncate(2); assert_eq!(vec, [1, 2]);+ +No truncation occurs when
+ +len
is greater than the vector's current +length:+let mut vec = vec![1, 2, 3]; +vec.truncate(8); +assert_eq!(vec, [1, 2, 3]);+ +Truncating when
+ +len == 0
is equivalent to calling theclear
+method.+let mut vec = vec![1, 2, 3]; +vec.truncate(0); +assert_eq!(vec, []);
fn as_slice(&self) -> &[T]
1.7.0Extracts a slice containing the entire vector.
Equivalent to
+ +&s[..]
.Examples
++use std::io::{self, Write}; +let buffer = vec![1, 2, 3, 5, 8]; +io::sink().write(buffer.as_slice()).unwrap();
fn as_mut_slice(&mut self) -> &mut [T]
1.7.0Extracts a mutable slice of the entire vector.
Equivalent to
+ +&mut s[..]
.Examples
++use std::io::{self, Read}; +let mut buffer = vec![0; 3]; +io::repeat(0b101).read_exact(buffer.as_mut_slice()).unwrap();
unsafe fn set_len(&mut self, len: usize)
1.0.0Sets the length of a vector.
@@ -172,11 +222,38 @@ effect. modifying its buffers, so it is up to the caller to ensure that the vector is actually the specified size. -Examples
+Examples
-let mut v = vec![1, 2, 3, 4]; +use std::ptr; + +let mut vec = vec!['r', 'u', 's', 't']; + unsafe { - v.set_len(1); + ptr::drop_in_place(&mut vec[3]); + vec.set_len(3); +} +assert_eq!(vec, ['r', 'u', 's']);+ +In this example, there is a memory leak since the memory locations +owned by the inner vectors were not freed prior to the
+ +set_len
call:+let mut vec = vec![vec![1, 0, 0], + vec![0, 1, 0], + vec![0, 0, 1]]; +unsafe { + vec.set_len(0); +}+ +In this example, the vector gets expanded from zero to four items +without any memory allocations occurring, resulting in vector +values of unallocated memory:
+ ++let mut vec: Vec<char> = Vec::new(); + +unsafe { + vec.set_len(4); }
fn swap_remove(&mut self, index: usize) -> T
1.0.0Removes an element from anywhere in the vector and return it, replacing @@ -187,7 +264,7 @@ it with the last element.
Panics
Panics if
-index
is out of bounds.Examples
+Examples
let mut v = vec!["foo", "bar", "baz", "qux"]; @@ -203,7 +280,7 @@ elements after it to the right.Panics
Panics if
-index
is greater than the vector's length.Examples
+Examples
let mut vec = vec![1, 2, 3]; vec.insert(1, 4); @@ -217,7 +294,7 @@ shifting all elements after it to the left.Panics
Panics if
-index
is out of bounds.Examples
+Examples
let mut v = vec![1, 2, 3]; assert_eq!(v.remove(1), 2); @@ -229,7 +306,7 @@ shifting all elements after it to the left. This method operates in place and preserves the order of the retained elements. -Examples
+Examples
let mut vec = vec![1, 2, 3, 4]; vec.retain(|&x| x%2 == 0); @@ -240,7 +317,7 @@ elements.Panics
Panics if the number of elements in the vector overflows a
-usize
.Examples
+Examples
let mut vec = vec![1, 2]; vec.push(3); @@ -249,7 +326,7 @@ elements.Removes the last element from a vector and returns it, or
-None
if it is empty.Examples
+Examples
let mut vec = vec![1, 2, 3]; assert_eq!(vec.pop(), Some(3)); @@ -260,7 +337,7 @@ is empty.Panics
Panics if the number of elements in the vector overflows a
-usize
.Examples
+Examples
let mut vec = vec![1, 2, 3]; let mut vec2 = vec![4, 5, 6]; @@ -281,7 +358,7 @@ if theDrain
value is leaked.Panics if the starting point is greater than the end point or if the end point is greater than the length of the vector.
-Examples
+Examples
let mut v = vec![1, 2, 3]; let u: Vec<_> = v.drain(1..).collect(); @@ -294,7 +371,7 @@ the end point is greater than the length of the vector.
fn clear(&mut self)
1.0.0Clears the vector, removing all values.
-Examples
+Examples
let mut v = vec![1, 2, 3]; @@ -304,14 +381,14 @@ the end point is greater than the length of the vector.
fn len(&self) -> usize
1.0.0Returns the number of elements in the vector.
-Examples
+Examples
let a = vec![1, 2, 3]; assert_eq!(a.len(), 3);
fn is_empty(&self) -> bool
1.0.0Returns
-true
if the vector contains no elements.Examples
+Examples
let mut v = Vec::new(); assert!(v.is_empty()); @@ -329,7 +406,7 @@ and the returnedSelf
contains elements[at, len)
.Panics
Panics if
-at > len
.Examples
+Examples
let mut vec = vec![1,2,3]; let vec2 = vec.split_off(1); @@ -342,7 +419,7 @@ and the returnedSelf
contains elements[at, len)
. difference, with each additional slot filled withvalue
. Ifnew_len
is less thanlen()
, theVec
is simply truncated. -Examples
+Examples
let mut vec = vec!["hello"]; vec.resize(3, "world"); @@ -362,7 +439,7 @@ specialized to work with slices instead. If and when Rust gets specialization this function will likely be deprecated (but still available). -Examples
+Examples
let mut vec = vec![1]; vec.extend_from_slice(&[2, 3, 4]); @@ -372,7 +449,7 @@ available).If the vector is sorted, this removes all duplicates.
-Examples
+Examples
let mut vec = vec![1, 2, 2, 3, 2]; diff --git a/iron/headers/struct.AccessControlAllowHeaders.html b/iron/headers/struct.AccessControlAllowHeaders.html index 54ecf1e6..c797ddac 100644 --- a/iron/headers/struct.AccessControlAllowHeaders.html +++ b/iron/headers/struct.AccessControlAllowHeaders.html @@ -146,25 +146,75 @@ may still inform the vector that there is space for a few more elements.Note that this will drop any excess capacity. Calling this and converting back to a vector with
+ +into_vec()
is equivalent to callingshrink_to_fit()
.Examples
++let v = vec![1, 2, 3]; + +let slice = v.into_boxed_slice();+ +Any excess capacity is removed:
+ ++let mut vec = Vec::with_capacity(10); +vec.extend([1, 2, 3].iter().cloned()); + +assert_eq!(vec.capacity(), 10); +let slice = vec.into_boxed_slice(); +assert_eq!(slice.into_vec().capacity(), 3);-
fn truncate(&mut self, len: usize)
1.0.0Shorten a vector to be
+len
elements long, dropping excess elements.Shortens the vector, keeping the first
len
elements and dropping +the rest.If
-len
is greater than the vector's current length, this has no effect.Examples
+The
+ +drain
method can emulatetruncate
, but causes the excess +elements to be returned instead of dropped.Examples
+Truncating a five element vector to two elements:
+let mut vec = vec![1, 2, 3, 4, 5]; vec.truncate(2); assert_eq!(vec, [1, 2]);+ +No truncation occurs when
+ +len
is greater than the vector's current +length:+let mut vec = vec![1, 2, 3]; +vec.truncate(8); +assert_eq!(vec, [1, 2, 3]);+ +Truncating when
+ +len == 0
is equivalent to calling theclear
+method.+let mut vec = vec![1, 2, 3]; +vec.truncate(0); +assert_eq!(vec, []);
fn as_slice(&self) -> &[T]
1.7.0Extracts a slice containing the entire vector.
Equivalent to
+ +&s[..]
.Examples
++use std::io::{self, Write}; +let buffer = vec![1, 2, 3, 5, 8]; +io::sink().write(buffer.as_slice()).unwrap();
fn as_mut_slice(&mut self) -> &mut [T]
1.7.0Extracts a mutable slice of the entire vector.
Equivalent to
+ +&mut s[..]
.Examples
++use std::io::{self, Read}; +let mut buffer = vec![0; 3]; +io::repeat(0b101).read_exact(buffer.as_mut_slice()).unwrap();
unsafe fn set_len(&mut self, len: usize)
1.0.0Sets the length of a vector.
@@ -172,11 +222,38 @@ effect. modifying its buffers, so it is up to the caller to ensure that the vector is actually the specified size. -Examples
+Examples
-let mut v = vec![1, 2, 3, 4]; +use std::ptr; + +let mut vec = vec!['r', 'u', 's', 't']; + unsafe { - v.set_len(1); + ptr::drop_in_place(&mut vec[3]); + vec.set_len(3); +} +assert_eq!(vec, ['r', 'u', 's']);+ +In this example, there is a memory leak since the memory locations +owned by the inner vectors were not freed prior to the
+ +set_len
call:+let mut vec = vec![vec![1, 0, 0], + vec![0, 1, 0], + vec![0, 0, 1]]; +unsafe { + vec.set_len(0); +}+ +In this example, the vector gets expanded from zero to four items +without any memory allocations occurring, resulting in vector +values of unallocated memory:
+ ++let mut vec: Vec<char> = Vec::new(); + +unsafe { + vec.set_len(4); }
fn swap_remove(&mut self, index: usize) -> T
1.0.0Removes an element from anywhere in the vector and return it, replacing @@ -187,7 +264,7 @@ it with the last element.
Panics
Panics if
-index
is out of bounds.Examples
+Examples
let mut v = vec!["foo", "bar", "baz", "qux"]; @@ -203,7 +280,7 @@ elements after it to the right.Panics
Panics if
-index
is greater than the vector's length.Examples
+Examples
let mut vec = vec![1, 2, 3]; vec.insert(1, 4); @@ -217,7 +294,7 @@ shifting all elements after it to the left.Panics
Panics if
-index
is out of bounds.Examples
+Examples
let mut v = vec![1, 2, 3]; assert_eq!(v.remove(1), 2); @@ -229,7 +306,7 @@ shifting all elements after it to the left. This method operates in place and preserves the order of the retained elements. -Examples
+Examples
let mut vec = vec![1, 2, 3, 4]; vec.retain(|&x| x%2 == 0); @@ -240,7 +317,7 @@ elements.Panics
Panics if the number of elements in the vector overflows a
-usize
.Examples
+Examples
let mut vec = vec![1, 2]; vec.push(3); @@ -249,7 +326,7 @@ elements.Removes the last element from a vector and returns it, or
-None
if it is empty.Examples
+Examples
let mut vec = vec![1, 2, 3]; assert_eq!(vec.pop(), Some(3)); @@ -260,7 +337,7 @@ is empty.Panics
Panics if the number of elements in the vector overflows a
-usize
.Examples
+Examples
let mut vec = vec![1, 2, 3]; let mut vec2 = vec![4, 5, 6]; @@ -281,7 +358,7 @@ if theDrain
value is leaked.Panics if the starting point is greater than the end point or if the end point is greater than the length of the vector.
-Examples
+Examples
let mut v = vec![1, 2, 3]; let u: Vec<_> = v.drain(1..).collect(); @@ -294,7 +371,7 @@ the end point is greater than the length of the vector.
fn clear(&mut self)
1.0.0Clears the vector, removing all values.
-Examples
+Examples
let mut v = vec![1, 2, 3]; @@ -304,14 +381,14 @@ the end point is greater than the length of the vector.
fn len(&self) -> usize
1.0.0Returns the number of elements in the vector.
-Examples
+Examples
let a = vec![1, 2, 3]; assert_eq!(a.len(), 3);
fn is_empty(&self) -> bool
1.0.0Returns
-true
if the vector contains no elements.Examples
+Examples
let mut v = Vec::new(); assert!(v.is_empty()); @@ -329,7 +406,7 @@ and the returnedSelf
contains elements[at, len)
.Panics
Panics if
-at > len
.Examples
+Examples
let mut vec = vec![1,2,3]; let vec2 = vec.split_off(1); @@ -342,7 +419,7 @@ and the returnedSelf
contains elements[at, len)
. difference, with each additional slot filled withvalue
. Ifnew_len
is less thanlen()
, theVec
is simply truncated. -Examples
+Examples
let mut vec = vec!["hello"]; vec.resize(3, "world"); @@ -362,7 +439,7 @@ specialized to work with slices instead. If and when Rust gets specialization this function will likely be deprecated (but still available). -Examples
+Examples
let mut vec = vec![1]; vec.extend_from_slice(&[2, 3, 4]); @@ -372,7 +449,7 @@ available).If the vector is sorted, this removes all duplicates.
-Examples
+Examples
let mut vec = vec![1, 2, 2, 3, 2]; diff --git a/iron/headers/struct.AccessControlAllowMethods.html b/iron/headers/struct.AccessControlAllowMethods.html index 521fac12..cee1469e 100644 --- a/iron/headers/struct.AccessControlAllowMethods.html +++ b/iron/headers/struct.AccessControlAllowMethods.html @@ -144,25 +144,75 @@ may still inform the vector that there is space for a few more elements.Note that this will drop any excess capacity. Calling this and converting back to a vector with
+ +into_vec()
is equivalent to callingshrink_to_fit()
.Examples
++let v = vec![1, 2, 3]; + +let slice = v.into_boxed_slice();+ +Any excess capacity is removed:
+ ++let mut vec = Vec::with_capacity(10); +vec.extend([1, 2, 3].iter().cloned()); + +assert_eq!(vec.capacity(), 10); +let slice = vec.into_boxed_slice(); +assert_eq!(slice.into_vec().capacity(), 3);-
fn truncate(&mut self, len: usize)
1.0.0Shorten a vector to be
+len
elements long, dropping excess elements.Shortens the vector, keeping the first
len
elements and dropping +the rest.If
-len
is greater than the vector's current length, this has no effect.Examples
+The
+ +drain
method can emulatetruncate
, but causes the excess +elements to be returned instead of dropped.Examples
+Truncating a five element vector to two elements:
+let mut vec = vec![1, 2, 3, 4, 5]; vec.truncate(2); assert_eq!(vec, [1, 2]);+ +No truncation occurs when
+ +len
is greater than the vector's current +length:+let mut vec = vec![1, 2, 3]; +vec.truncate(8); +assert_eq!(vec, [1, 2, 3]);+ +Truncating when
+ +len == 0
is equivalent to calling theclear
+method.+let mut vec = vec![1, 2, 3]; +vec.truncate(0); +assert_eq!(vec, []);
fn as_slice(&self) -> &[T]
1.7.0Extracts a slice containing the entire vector.
Equivalent to
+ +&s[..]
.Examples
++use std::io::{self, Write}; +let buffer = vec![1, 2, 3, 5, 8]; +io::sink().write(buffer.as_slice()).unwrap();
fn as_mut_slice(&mut self) -> &mut [T]
1.7.0Extracts a mutable slice of the entire vector.
Equivalent to
+ +&mut s[..]
.Examples
++use std::io::{self, Read}; +let mut buffer = vec![0; 3]; +io::repeat(0b101).read_exact(buffer.as_mut_slice()).unwrap();
unsafe fn set_len(&mut self, len: usize)
1.0.0Sets the length of a vector.
@@ -170,11 +220,38 @@ effect. modifying its buffers, so it is up to the caller to ensure that the vector is actually the specified size. -Examples
+Examples
-let mut v = vec![1, 2, 3, 4]; +use std::ptr; + +let mut vec = vec!['r', 'u', 's', 't']; + unsafe { - v.set_len(1); + ptr::drop_in_place(&mut vec[3]); + vec.set_len(3); +} +assert_eq!(vec, ['r', 'u', 's']);+ +In this example, there is a memory leak since the memory locations +owned by the inner vectors were not freed prior to the
+ +set_len
call:+let mut vec = vec![vec![1, 0, 0], + vec![0, 1, 0], + vec![0, 0, 1]]; +unsafe { + vec.set_len(0); +}+ +In this example, the vector gets expanded from zero to four items +without any memory allocations occurring, resulting in vector +values of unallocated memory:
+ ++let mut vec: Vec<char> = Vec::new(); + +unsafe { + vec.set_len(4); }
fn swap_remove(&mut self, index: usize) -> T
1.0.0Removes an element from anywhere in the vector and return it, replacing @@ -185,7 +262,7 @@ it with the last element.
Panics
Panics if
-index
is out of bounds.Examples
+Examples
let mut v = vec!["foo", "bar", "baz", "qux"]; @@ -201,7 +278,7 @@ elements after it to the right.Panics
Panics if
-index
is greater than the vector's length.Examples
+Examples
let mut vec = vec![1, 2, 3]; vec.insert(1, 4); @@ -215,7 +292,7 @@ shifting all elements after it to the left.Panics
Panics if
-index
is out of bounds.Examples
+Examples
let mut v = vec![1, 2, 3]; assert_eq!(v.remove(1), 2); @@ -227,7 +304,7 @@ shifting all elements after it to the left. This method operates in place and preserves the order of the retained elements. -Examples
+Examples
let mut vec = vec![1, 2, 3, 4]; vec.retain(|&x| x%2 == 0); @@ -238,7 +315,7 @@ elements.Panics
Panics if the number of elements in the vector overflows a
-usize
.Examples
+Examples
let mut vec = vec![1, 2]; vec.push(3); @@ -247,7 +324,7 @@ elements.Removes the last element from a vector and returns it, or
-None
if it is empty.Examples
+Examples
let mut vec = vec![1, 2, 3]; assert_eq!(vec.pop(), Some(3)); @@ -258,7 +335,7 @@ is empty.Panics
Panics if the number of elements in the vector overflows a
-usize
.Examples
+Examples
let mut vec = vec![1, 2, 3]; let mut vec2 = vec![4, 5, 6]; @@ -279,7 +356,7 @@ if theDrain
value is leaked.Panics if the starting point is greater than the end point or if the end point is greater than the length of the vector.
-Examples
+Examples
let mut v = vec![1, 2, 3]; let u: Vec<_> = v.drain(1..).collect(); @@ -292,7 +369,7 @@ the end point is greater than the length of the vector.
fn clear(&mut self)
1.0.0Clears the vector, removing all values.
-Examples
+Examples
let mut v = vec![1, 2, 3]; @@ -302,14 +379,14 @@ the end point is greater than the length of the vector.
fn len(&self) -> usize
1.0.0Returns the number of elements in the vector.
-Examples
+Examples
let a = vec![1, 2, 3]; assert_eq!(a.len(), 3);
fn is_empty(&self) -> bool
1.0.0Returns
-true
if the vector contains no elements.Examples
+Examples
let mut v = Vec::new(); assert!(v.is_empty()); @@ -327,7 +404,7 @@ and the returnedSelf
contains elements[at, len)
.Panics
Panics if
-at > len
.Examples
+Examples
let mut vec = vec![1,2,3]; let vec2 = vec.split_off(1); @@ -340,7 +417,7 @@ and the returnedSelf
contains elements[at, len)
. difference, with each additional slot filled withvalue
. Ifnew_len
is less thanlen()
, theVec
is simply truncated. -Examples
+Examples
let mut vec = vec!["hello"]; vec.resize(3, "world"); @@ -360,7 +437,7 @@ specialized to work with slices instead. If and when Rust gets specialization this function will likely be deprecated (but still available). -Examples
+Examples
let mut vec = vec![1]; vec.extend_from_slice(&[2, 3, 4]); @@ -370,7 +447,7 @@ available).If the vector is sorted, this removes all duplicates.
-Examples
+Examples
let mut vec = vec![1, 2, 2, 3, 2]; diff --git a/iron/headers/struct.AccessControlExposeHeaders.html b/iron/headers/struct.AccessControlExposeHeaders.html index 86063ef6..4a49c94f 100644 --- a/iron/headers/struct.AccessControlExposeHeaders.html +++ b/iron/headers/struct.AccessControlExposeHeaders.html @@ -148,25 +148,75 @@ may still inform the vector that there is space for a few more elements.Note that this will drop any excess capacity. Calling this and converting back to a vector with
+ +into_vec()
is equivalent to callingshrink_to_fit()
.Examples
++let v = vec![1, 2, 3]; + +let slice = v.into_boxed_slice();+ +Any excess capacity is removed:
+ ++let mut vec = Vec::with_capacity(10); +vec.extend([1, 2, 3].iter().cloned()); + +assert_eq!(vec.capacity(), 10); +let slice = vec.into_boxed_slice(); +assert_eq!(slice.into_vec().capacity(), 3);-
fn truncate(&mut self, len: usize)
1.0.0Shorten a vector to be
+len
elements long, dropping excess elements.Shortens the vector, keeping the first
len
elements and dropping +the rest.If
-len
is greater than the vector's current length, this has no effect.Examples
+The
+ +drain
method can emulatetruncate
, but causes the excess +elements to be returned instead of dropped.Examples
+Truncating a five element vector to two elements:
+let mut vec = vec![1, 2, 3, 4, 5]; vec.truncate(2); assert_eq!(vec, [1, 2]);+ +No truncation occurs when
+ +len
is greater than the vector's current +length:+let mut vec = vec![1, 2, 3]; +vec.truncate(8); +assert_eq!(vec, [1, 2, 3]);+ +Truncating when
+ +len == 0
is equivalent to calling theclear
+method.+let mut vec = vec![1, 2, 3]; +vec.truncate(0); +assert_eq!(vec, []);
fn as_slice(&self) -> &[T]
1.7.0Extracts a slice containing the entire vector.
Equivalent to
+ +&s[..]
.Examples
++use std::io::{self, Write}; +let buffer = vec![1, 2, 3, 5, 8]; +io::sink().write(buffer.as_slice()).unwrap();
fn as_mut_slice(&mut self) -> &mut [T]
1.7.0Extracts a mutable slice of the entire vector.
Equivalent to
+ +&mut s[..]
.Examples
++use std::io::{self, Read}; +let mut buffer = vec![0; 3]; +io::repeat(0b101).read_exact(buffer.as_mut_slice()).unwrap();
unsafe fn set_len(&mut self, len: usize)
1.0.0Sets the length of a vector.
@@ -174,11 +224,38 @@ effect. modifying its buffers, so it is up to the caller to ensure that the vector is actually the specified size. -Examples
+Examples
-let mut v = vec![1, 2, 3, 4]; +use std::ptr; + +let mut vec = vec!['r', 'u', 's', 't']; + unsafe { - v.set_len(1); + ptr::drop_in_place(&mut vec[3]); + vec.set_len(3); +} +assert_eq!(vec, ['r', 'u', 's']);+ +In this example, there is a memory leak since the memory locations +owned by the inner vectors were not freed prior to the
+ +set_len
call:+let mut vec = vec![vec![1, 0, 0], + vec![0, 1, 0], + vec![0, 0, 1]]; +unsafe { + vec.set_len(0); +}+ +In this example, the vector gets expanded from zero to four items +without any memory allocations occurring, resulting in vector +values of unallocated memory:
+ ++let mut vec: Vec<char> = Vec::new(); + +unsafe { + vec.set_len(4); }
fn swap_remove(&mut self, index: usize) -> T
1.0.0Removes an element from anywhere in the vector and return it, replacing @@ -189,7 +266,7 @@ it with the last element.
Panics
Panics if
-index
is out of bounds.Examples
+Examples
let mut v = vec!["foo", "bar", "baz", "qux"]; @@ -205,7 +282,7 @@ elements after it to the right.Panics
Panics if
-index
is greater than the vector's length.Examples
+Examples
let mut vec = vec![1, 2, 3]; vec.insert(1, 4); @@ -219,7 +296,7 @@ shifting all elements after it to the left.Panics
Panics if
-index
is out of bounds.Examples
+Examples
let mut v = vec![1, 2, 3]; assert_eq!(v.remove(1), 2); @@ -231,7 +308,7 @@ shifting all elements after it to the left. This method operates in place and preserves the order of the retained elements. -Examples
+Examples
let mut vec = vec![1, 2, 3, 4]; vec.retain(|&x| x%2 == 0); @@ -242,7 +319,7 @@ elements.Panics
Panics if the number of elements in the vector overflows a
-usize
.Examples
+Examples
let mut vec = vec![1, 2]; vec.push(3); @@ -251,7 +328,7 @@ elements.Removes the last element from a vector and returns it, or
-None
if it is empty.Examples
+Examples
let mut vec = vec![1, 2, 3]; assert_eq!(vec.pop(), Some(3)); @@ -262,7 +339,7 @@ is empty.Panics
Panics if the number of elements in the vector overflows a
-usize
.Examples
+Examples
let mut vec = vec![1, 2, 3]; let mut vec2 = vec![4, 5, 6]; @@ -283,7 +360,7 @@ if theDrain
value is leaked.Panics if the starting point is greater than the end point or if the end point is greater than the length of the vector.
-Examples
+Examples
let mut v = vec![1, 2, 3]; let u: Vec<_> = v.drain(1..).collect(); @@ -296,7 +373,7 @@ the end point is greater than the length of the vector.
fn clear(&mut self)
1.0.0Clears the vector, removing all values.
-Examples
+Examples
let mut v = vec![1, 2, 3]; @@ -306,14 +383,14 @@ the end point is greater than the length of the vector.
fn len(&self) -> usize
1.0.0Returns the number of elements in the vector.
-Examples
+Examples
let a = vec![1, 2, 3]; assert_eq!(a.len(), 3);
fn is_empty(&self) -> bool
1.0.0Returns
-true
if the vector contains no elements.Examples
+Examples
let mut v = Vec::new(); assert!(v.is_empty()); @@ -331,7 +408,7 @@ and the returnedSelf
contains elements[at, len)
.Panics
Panics if
-at > len
.Examples
+Examples
let mut vec = vec![1,2,3]; let vec2 = vec.split_off(1); @@ -344,7 +421,7 @@ and the returnedSelf
contains elements[at, len)
. difference, with each additional slot filled withvalue
. Ifnew_len
is less thanlen()
, theVec
is simply truncated. -Examples
+Examples
let mut vec = vec!["hello"]; vec.resize(3, "world"); @@ -364,7 +441,7 @@ specialized to work with slices instead. If and when Rust gets specialization this function will likely be deprecated (but still available). -Examples
+Examples
let mut vec = vec![1]; vec.extend_from_slice(&[2, 3, 4]); @@ -374,7 +451,7 @@ available).If the vector is sorted, this removes all duplicates.
-Examples
+Examples
let mut vec = vec![1, 2, 2, 3, 2]; diff --git a/iron/headers/struct.AccessControlMaxAge.html b/iron/headers/struct.AccessControlMaxAge.html index 676fe3da..d90b36ae 100644 --- a/iron/headers/struct.AccessControlMaxAge.html +++ b/iron/headers/struct.AccessControlMaxAge.html @@ -115,6 +115,8 @@ ofself
.Shifts the bits to the left by a specified amount,
+n
, wrapping the truncated bits to the end of the resulting integer.Please note this isn't the same operation as
+<<
!Examples
Basic usage:
@@ -128,6 +130,8 @@ wrapping the truncated bits to the end of the resulting integer. wrapping the truncated bits to the beginning of the resulting integer. +Please note this isn't the same operation as
+>>
!Examples
Basic usage:
diff --git a/iron/headers/struct.AccessControlRequestHeaders.html b/iron/headers/struct.AccessControlRequestHeaders.html index 12401960..20b90bb5 100644 --- a/iron/headers/struct.AccessControlRequestHeaders.html +++ b/iron/headers/struct.AccessControlRequestHeaders.html @@ -146,25 +146,75 @@ may still inform the vector that there is space for a few more elements.Note that this will drop any excess capacity. Calling this and converting back to a vector with
+ +into_vec()
is equivalent to callingshrink_to_fit()
.Examples
++let v = vec![1, 2, 3]; + +let slice = v.into_boxed_slice();+ +Any excess capacity is removed:
+ ++let mut vec = Vec::with_capacity(10); +vec.extend([1, 2, 3].iter().cloned()); + +assert_eq!(vec.capacity(), 10); +let slice = vec.into_boxed_slice(); +assert_eq!(slice.into_vec().capacity(), 3);-
fn truncate(&mut self, len: usize)
1.0.0Shorten a vector to be
+len
elements long, dropping excess elements.Shortens the vector, keeping the first
len
elements and dropping +the rest.If
-len
is greater than the vector's current length, this has no effect.Examples
+The
+ +drain
method can emulatetruncate
, but causes the excess +elements to be returned instead of dropped.Examples
+Truncating a five element vector to two elements:
+let mut vec = vec![1, 2, 3, 4, 5]; vec.truncate(2); assert_eq!(vec, [1, 2]);+ +No truncation occurs when
+ +len
is greater than the vector's current +length:+let mut vec = vec![1, 2, 3]; +vec.truncate(8); +assert_eq!(vec, [1, 2, 3]);+ +Truncating when
+ +len == 0
is equivalent to calling theclear
+method.+let mut vec = vec![1, 2, 3]; +vec.truncate(0); +assert_eq!(vec, []);
fn as_slice(&self) -> &[T]
1.7.0Extracts a slice containing the entire vector.
Equivalent to
+ +&s[..]
.Examples
++use std::io::{self, Write}; +let buffer = vec![1, 2, 3, 5, 8]; +io::sink().write(buffer.as_slice()).unwrap();
fn as_mut_slice(&mut self) -> &mut [T]
1.7.0Extracts a mutable slice of the entire vector.
Equivalent to
+ +&mut s[..]
.Examples
++use std::io::{self, Read}; +let mut buffer = vec![0; 3]; +io::repeat(0b101).read_exact(buffer.as_mut_slice()).unwrap();
unsafe fn set_len(&mut self, len: usize)
1.0.0Sets the length of a vector.
@@ -172,11 +222,38 @@ effect. modifying its buffers, so it is up to the caller to ensure that the vector is actually the specified size. -Examples
+Examples
-let mut v = vec![1, 2, 3, 4]; +use std::ptr; + +let mut vec = vec!['r', 'u', 's', 't']; + unsafe { - v.set_len(1); + ptr::drop_in_place(&mut vec[3]); + vec.set_len(3); +} +assert_eq!(vec, ['r', 'u', 's']);+ +In this example, there is a memory leak since the memory locations +owned by the inner vectors were not freed prior to the
+ +set_len
call:+let mut vec = vec![vec![1, 0, 0], + vec![0, 1, 0], + vec![0, 0, 1]]; +unsafe { + vec.set_len(0); +}+ +In this example, the vector gets expanded from zero to four items +without any memory allocations occurring, resulting in vector +values of unallocated memory:
+ ++let mut vec: Vec<char> = Vec::new(); + +unsafe { + vec.set_len(4); }
fn swap_remove(&mut self, index: usize) -> T
1.0.0Removes an element from anywhere in the vector and return it, replacing @@ -187,7 +264,7 @@ it with the last element.
Panics
Panics if
-index
is out of bounds.Examples
+Examples
let mut v = vec!["foo", "bar", "baz", "qux"]; @@ -203,7 +280,7 @@ elements after it to the right.Panics
Panics if
-index
is greater than the vector's length.Examples
+Examples
let mut vec = vec![1, 2, 3]; vec.insert(1, 4); @@ -217,7 +294,7 @@ shifting all elements after it to the left.Panics
Panics if
-index
is out of bounds.Examples
+Examples
let mut v = vec![1, 2, 3]; assert_eq!(v.remove(1), 2); @@ -229,7 +306,7 @@ shifting all elements after it to the left. This method operates in place and preserves the order of the retained elements. -Examples
+Examples
let mut vec = vec![1, 2, 3, 4]; vec.retain(|&x| x%2 == 0); @@ -240,7 +317,7 @@ elements.Panics
Panics if the number of elements in the vector overflows a
-usize
.Examples
+Examples
let mut vec = vec![1, 2]; vec.push(3); @@ -249,7 +326,7 @@ elements.Removes the last element from a vector and returns it, or
-None
if it is empty.Examples
+Examples
let mut vec = vec![1, 2, 3]; assert_eq!(vec.pop(), Some(3)); @@ -260,7 +337,7 @@ is empty.Panics
Panics if the number of elements in the vector overflows a
-usize
.Examples
+Examples
let mut vec = vec![1, 2, 3]; let mut vec2 = vec![4, 5, 6]; @@ -281,7 +358,7 @@ if theDrain
value is leaked.Panics if the starting point is greater than the end point or if the end point is greater than the length of the vector.
-Examples
+Examples
let mut v = vec![1, 2, 3]; let u: Vec<_> = v.drain(1..).collect(); @@ -294,7 +371,7 @@ the end point is greater than the length of the vector.
fn clear(&mut self)
1.0.0Clears the vector, removing all values.
-Examples
+Examples
let mut v = vec![1, 2, 3]; @@ -304,14 +381,14 @@ the end point is greater than the length of the vector.
fn len(&self) -> usize
1.0.0Returns the number of elements in the vector.
-Examples
+Examples
let a = vec![1, 2, 3]; assert_eq!(a.len(), 3);
fn is_empty(&self) -> bool
1.0.0Returns
-true
if the vector contains no elements.Examples
+Examples
let mut v = Vec::new(); assert!(v.is_empty()); @@ -329,7 +406,7 @@ and the returnedSelf
contains elements[at, len)
.Panics
Panics if
-at > len
.Examples
+Examples
let mut vec = vec![1,2,3]; let vec2 = vec.split_off(1); @@ -342,7 +419,7 @@ and the returnedSelf
contains elements[at, len)
. difference, with each additional slot filled withvalue
. Ifnew_len
is less thanlen()
, theVec
is simply truncated. -Examples
+Examples
let mut vec = vec!["hello"]; vec.resize(3, "world"); @@ -362,7 +439,7 @@ specialized to work with slices instead. If and when Rust gets specialization this function will likely be deprecated (but still available). -Examples
+Examples
let mut vec = vec![1]; vec.extend_from_slice(&[2, 3, 4]); @@ -372,7 +449,7 @@ available).If the vector is sorted, this removes all duplicates.
-Examples
+Examples
let mut vec = vec![1, 2, 2, 3, 2]; diff --git a/iron/headers/struct.Allow.html b/iron/headers/struct.Allow.html index 4ea5649e..0d6f4740 100644 --- a/iron/headers/struct.Allow.html +++ b/iron/headers/struct.Allow.html @@ -146,25 +146,75 @@ may still inform the vector that there is space for a few more elements.Note that this will drop any excess capacity. Calling this and converting back to a vector with
+ +into_vec()
is equivalent to callingshrink_to_fit()
.Examples
++let v = vec![1, 2, 3]; + +let slice = v.into_boxed_slice();+ +Any excess capacity is removed:
+ ++let mut vec = Vec::with_capacity(10); +vec.extend([1, 2, 3].iter().cloned()); + +assert_eq!(vec.capacity(), 10); +let slice = vec.into_boxed_slice(); +assert_eq!(slice.into_vec().capacity(), 3);-
fn truncate(&mut self, len: usize)
1.0.0Shorten a vector to be
+len
elements long, dropping excess elements.Shortens the vector, keeping the first
len
elements and dropping +the rest.If
-len
is greater than the vector's current length, this has no effect.Examples
+The
+ +drain
method can emulatetruncate
, but causes the excess +elements to be returned instead of dropped.Examples
+Truncating a five element vector to two elements:
+let mut vec = vec![1, 2, 3, 4, 5]; vec.truncate(2); assert_eq!(vec, [1, 2]);+ +No truncation occurs when
+ +len
is greater than the vector's current +length:+let mut vec = vec![1, 2, 3]; +vec.truncate(8); +assert_eq!(vec, [1, 2, 3]);+ +Truncating when
+ +len == 0
is equivalent to calling theclear
+method.+let mut vec = vec![1, 2, 3]; +vec.truncate(0); +assert_eq!(vec, []);
fn as_slice(&self) -> &[T]
1.7.0Extracts a slice containing the entire vector.
Equivalent to
+ +&s[..]
.Examples
++use std::io::{self, Write}; +let buffer = vec![1, 2, 3, 5, 8]; +io::sink().write(buffer.as_slice()).unwrap();
fn as_mut_slice(&mut self) -> &mut [T]
1.7.0Extracts a mutable slice of the entire vector.
Equivalent to
+ +&mut s[..]
.Examples
++use std::io::{self, Read}; +let mut buffer = vec![0; 3]; +io::repeat(0b101).read_exact(buffer.as_mut_slice()).unwrap();
unsafe fn set_len(&mut self, len: usize)
1.0.0Sets the length of a vector.
@@ -172,11 +222,38 @@ effect. modifying its buffers, so it is up to the caller to ensure that the vector is actually the specified size. -Examples
+Examples
-let mut v = vec![1, 2, 3, 4]; +use std::ptr; + +let mut vec = vec!['r', 'u', 's', 't']; + unsafe { - v.set_len(1); + ptr::drop_in_place(&mut vec[3]); + vec.set_len(3); +} +assert_eq!(vec, ['r', 'u', 's']);+ +In this example, there is a memory leak since the memory locations +owned by the inner vectors were not freed prior to the
+ +set_len
call:+let mut vec = vec![vec![1, 0, 0], + vec![0, 1, 0], + vec![0, 0, 1]]; +unsafe { + vec.set_len(0); +}+ +In this example, the vector gets expanded from zero to four items +without any memory allocations occurring, resulting in vector +values of unallocated memory:
+ ++let mut vec: Vec<char> = Vec::new(); + +unsafe { + vec.set_len(4); }
fn swap_remove(&mut self, index: usize) -> T
1.0.0Removes an element from anywhere in the vector and return it, replacing @@ -187,7 +264,7 @@ it with the last element.
Panics
Panics if
-index
is out of bounds.Examples
+Examples
let mut v = vec!["foo", "bar", "baz", "qux"]; @@ -203,7 +280,7 @@ elements after it to the right.Panics
Panics if
-index
is greater than the vector's length.Examples
+Examples
let mut vec = vec![1, 2, 3]; vec.insert(1, 4); @@ -217,7 +294,7 @@ shifting all elements after it to the left.Panics
Panics if
-index
is out of bounds.Examples
+Examples
let mut v = vec![1, 2, 3]; assert_eq!(v.remove(1), 2); @@ -229,7 +306,7 @@ shifting all elements after it to the left. This method operates in place and preserves the order of the retained elements. -Examples
+Examples
let mut vec = vec![1, 2, 3, 4]; vec.retain(|&x| x%2 == 0); @@ -240,7 +317,7 @@ elements.Panics
Panics if the number of elements in the vector overflows a
-usize
.Examples
+Examples
let mut vec = vec![1, 2]; vec.push(3); @@ -249,7 +326,7 @@ elements.Removes the last element from a vector and returns it, or
-None
if it is empty.Examples
+Examples
let mut vec = vec![1, 2, 3]; assert_eq!(vec.pop(), Some(3)); @@ -260,7 +337,7 @@ is empty.Panics
Panics if the number of elements in the vector overflows a
-usize
.Examples
+Examples
let mut vec = vec![1, 2, 3]; let mut vec2 = vec![4, 5, 6]; @@ -281,7 +358,7 @@ if theDrain
value is leaked.Panics if the starting point is greater than the end point or if the end point is greater than the length of the vector.
-Examples
+Examples
let mut v = vec![1, 2, 3]; let u: Vec<_> = v.drain(1..).collect(); @@ -294,7 +371,7 @@ the end point is greater than the length of the vector.
fn clear(&mut self)
1.0.0Clears the vector, removing all values.
-Examples
+Examples
let mut v = vec![1, 2, 3]; @@ -304,14 +381,14 @@ the end point is greater than the length of the vector.
fn len(&self) -> usize
1.0.0Returns the number of elements in the vector.
-Examples
+Examples
let a = vec![1, 2, 3]; assert_eq!(a.len(), 3);
fn is_empty(&self) -> bool
1.0.0Returns
-true
if the vector contains no elements.Examples
+Examples
let mut v = Vec::new(); assert!(v.is_empty()); @@ -329,7 +406,7 @@ and the returnedSelf
contains elements[at, len)
.Panics
Panics if
-at > len
.Examples
+Examples
let mut vec = vec![1,2,3]; let vec2 = vec.split_off(1); @@ -342,7 +419,7 @@ and the returnedSelf
contains elements[at, len)
. difference, with each additional slot filled withvalue
. Ifnew_len
is less thanlen()
, theVec
is simply truncated. -Examples
+Examples
let mut vec = vec!["hello"]; vec.resize(3, "world"); @@ -362,7 +439,7 @@ specialized to work with slices instead. If and when Rust gets specialization this function will likely be deprecated (but still available). -Examples
+Examples
let mut vec = vec![1]; vec.extend_from_slice(&[2, 3, 4]); @@ -372,7 +449,7 @@ available).If the vector is sorted, this removes all duplicates.
-Examples
+Examples
let mut vec = vec![1, 2, 2, 3, 2]; diff --git a/iron/headers/struct.Authorization.html b/iron/headers/struct.Authorization.html index 680563a4..644031cf 100644 --- a/iron/headers/struct.Authorization.html +++ b/iron/headers/struct.Authorization.html @@ -48,7 +48,7 @@ [−] [src] -pub struct Authorization<S> where S: Scheme(pub S);
+
Authorization
header, defined in RFC7235pub struct Authorization<S>(pub S) where S: Scheme;
Authorization
header, defined in RFC7235The
Authorization
header field allows a user agent to authenticate itself with an origin server -- usually, but not necessarily, after diff --git a/iron/headers/struct.CacheControl.html b/iron/headers/struct.CacheControl.html index b78d8d25..ad0f86f3 100644 --- a/iron/headers/struct.CacheControl.html +++ b/iron/headers/struct.CacheControl.html @@ -146,25 +146,75 @@ may still inform the vector that there is space for a few more elements.Note that this will drop any excess capacity. Calling this and converting back to a vector with
+ +into_vec()
is equivalent to callingshrink_to_fit()
.Examples
++let v = vec![1, 2, 3]; + +let slice = v.into_boxed_slice();+ +Any excess capacity is removed:
+ ++let mut vec = Vec::with_capacity(10); +vec.extend([1, 2, 3].iter().cloned()); + +assert_eq!(vec.capacity(), 10); +let slice = vec.into_boxed_slice(); +assert_eq!(slice.into_vec().capacity(), 3);-
fn truncate(&mut self, len: usize)
1.0.0Shorten a vector to be
+len
elements long, dropping excess elements.Shortens the vector, keeping the first
len
elements and dropping +the rest.If
-len
is greater than the vector's current length, this has no effect.Examples
+The
+ +drain
method can emulatetruncate
, but causes the excess +elements to be returned instead of dropped.Examples
+Truncating a five element vector to two elements:
+let mut vec = vec![1, 2, 3, 4, 5]; vec.truncate(2); assert_eq!(vec, [1, 2]);+ +No truncation occurs when
+ +len
is greater than the vector's current +length:+let mut vec = vec![1, 2, 3]; +vec.truncate(8); +assert_eq!(vec, [1, 2, 3]);+ +Truncating when
+ +len == 0
is equivalent to calling theclear
+method.+let mut vec = vec![1, 2, 3]; +vec.truncate(0); +assert_eq!(vec, []);
fn as_slice(&self) -> &[T]
1.7.0Extracts a slice containing the entire vector.
Equivalent to
+ +&s[..]
.Examples
++use std::io::{self, Write}; +let buffer = vec![1, 2, 3, 5, 8]; +io::sink().write(buffer.as_slice()).unwrap();
fn as_mut_slice(&mut self) -> &mut [T]
1.7.0Extracts a mutable slice of the entire vector.
Equivalent to
+ +&mut s[..]
.Examples
++use std::io::{self, Read}; +let mut buffer = vec![0; 3]; +io::repeat(0b101).read_exact(buffer.as_mut_slice()).unwrap();
unsafe fn set_len(&mut self, len: usize)
1.0.0Sets the length of a vector.
@@ -172,11 +222,38 @@ effect. modifying its buffers, so it is up to the caller to ensure that the vector is actually the specified size. -Examples
+Examples
-let mut v = vec![1, 2, 3, 4]; +use std::ptr; + +let mut vec = vec!['r', 'u', 's', 't']; + unsafe { - v.set_len(1); + ptr::drop_in_place(&mut vec[3]); + vec.set_len(3); +} +assert_eq!(vec, ['r', 'u', 's']);+ +In this example, there is a memory leak since the memory locations +owned by the inner vectors were not freed prior to the
+ +set_len
call:+let mut vec = vec![vec![1, 0, 0], + vec![0, 1, 0], + vec![0, 0, 1]]; +unsafe { + vec.set_len(0); +}+ +In this example, the vector gets expanded from zero to four items +without any memory allocations occurring, resulting in vector +values of unallocated memory:
+ ++let mut vec: Vec<char> = Vec::new(); + +unsafe { + vec.set_len(4); }
fn swap_remove(&mut self, index: usize) -> T
1.0.0Removes an element from anywhere in the vector and return it, replacing @@ -187,7 +264,7 @@ it with the last element.
Panics
Panics if
-index
is out of bounds.Examples
+Examples
let mut v = vec!["foo", "bar", "baz", "qux"]; @@ -203,7 +280,7 @@ elements after it to the right.Panics
Panics if
-index
is greater than the vector's length.Examples
+Examples
let mut vec = vec![1, 2, 3]; vec.insert(1, 4); @@ -217,7 +294,7 @@ shifting all elements after it to the left.Panics
Panics if
-index
is out of bounds.Examples
+Examples
let mut v = vec![1, 2, 3]; assert_eq!(v.remove(1), 2); @@ -229,7 +306,7 @@ shifting all elements after it to the left. This method operates in place and preserves the order of the retained elements. -Examples
+Examples
let mut vec = vec![1, 2, 3, 4]; vec.retain(|&x| x%2 == 0); @@ -240,7 +317,7 @@ elements.Panics
Panics if the number of elements in the vector overflows a
-usize
.Examples
+Examples
let mut vec = vec![1, 2]; vec.push(3); @@ -249,7 +326,7 @@ elements.Removes the last element from a vector and returns it, or
-None
if it is empty.Examples
+Examples
let mut vec = vec![1, 2, 3]; assert_eq!(vec.pop(), Some(3)); @@ -260,7 +337,7 @@ is empty.Panics
Panics if the number of elements in the vector overflows a
-usize
.Examples
+Examples
let mut vec = vec![1, 2, 3]; let mut vec2 = vec![4, 5, 6]; @@ -281,7 +358,7 @@ if theDrain
value is leaked.Panics if the starting point is greater than the end point or if the end point is greater than the length of the vector.
-Examples
+Examples
let mut v = vec![1, 2, 3]; let u: Vec<_> = v.drain(1..).collect(); @@ -294,7 +371,7 @@ the end point is greater than the length of the vector.
fn clear(&mut self)
1.0.0Clears the vector, removing all values.
-Examples
+Examples
let mut v = vec![1, 2, 3]; @@ -304,14 +381,14 @@ the end point is greater than the length of the vector.
fn len(&self) -> usize
1.0.0Returns the number of elements in the vector.
-Examples
+Examples
let a = vec![1, 2, 3]; assert_eq!(a.len(), 3);
fn is_empty(&self) -> bool
1.0.0Returns
-true
if the vector contains no elements.Examples
+Examples
let mut v = Vec::new(); assert!(v.is_empty()); @@ -329,7 +406,7 @@ and the returnedSelf
contains elements[at, len)
.Panics
Panics if
-at > len
.Examples
+Examples
let mut vec = vec![1,2,3]; let vec2 = vec.split_off(1); @@ -342,7 +419,7 @@ and the returnedSelf
contains elements[at, len)
. difference, with each additional slot filled withvalue
. Ifnew_len
is less thanlen()
, theVec
is simply truncated. -Examples
+Examples
let mut vec = vec!["hello"]; vec.resize(3, "world"); @@ -362,7 +439,7 @@ specialized to work with slices instead. If and when Rust gets specialization this function will likely be deprecated (but still available). -Examples
+Examples
let mut vec = vec![1]; vec.extend_from_slice(&[2, 3, 4]); @@ -372,7 +449,7 @@ available).If the vector is sorted, this removes all duplicates.
-Examples
+Examples
let mut vec = vec![1, 2, 2, 3, 2]; diff --git a/iron/headers/struct.Connection.html b/iron/headers/struct.Connection.html index 814e149b..0edc2507 100644 --- a/iron/headers/struct.Connection.html +++ b/iron/headers/struct.Connection.html @@ -148,25 +148,75 @@ may still inform the vector that there is space for a few more elements.Note that this will drop any excess capacity. Calling this and converting back to a vector with
+ +into_vec()
is equivalent to callingshrink_to_fit()
.Examples
++let v = vec![1, 2, 3]; + +let slice = v.into_boxed_slice();+ +Any excess capacity is removed:
+ ++let mut vec = Vec::with_capacity(10); +vec.extend([1, 2, 3].iter().cloned()); + +assert_eq!(vec.capacity(), 10); +let slice = vec.into_boxed_slice(); +assert_eq!(slice.into_vec().capacity(), 3);-
fn truncate(&mut self, len: usize)
1.0.0Shorten a vector to be
+len
elements long, dropping excess elements.Shortens the vector, keeping the first
len
elements and dropping +the rest.If
-len
is greater than the vector's current length, this has no effect.Examples
+The
+ +drain
method can emulatetruncate
, but causes the excess +elements to be returned instead of dropped.Examples
+Truncating a five element vector to two elements:
+let mut vec = vec![1, 2, 3, 4, 5]; vec.truncate(2); assert_eq!(vec, [1, 2]);+ +No truncation occurs when
+ +len
is greater than the vector's current +length:+let mut vec = vec![1, 2, 3]; +vec.truncate(8); +assert_eq!(vec, [1, 2, 3]);+ +Truncating when
+ +len == 0
is equivalent to calling theclear
+method.+let mut vec = vec![1, 2, 3]; +vec.truncate(0); +assert_eq!(vec, []);
fn as_slice(&self) -> &[T]
1.7.0Extracts a slice containing the entire vector.
Equivalent to
+ +&s[..]
.Examples
++use std::io::{self, Write}; +let buffer = vec![1, 2, 3, 5, 8]; +io::sink().write(buffer.as_slice()).unwrap();
fn as_mut_slice(&mut self) -> &mut [T]
1.7.0Extracts a mutable slice of the entire vector.
Equivalent to
+ +&mut s[..]
.Examples
++use std::io::{self, Read}; +let mut buffer = vec![0; 3]; +io::repeat(0b101).read_exact(buffer.as_mut_slice()).unwrap();
unsafe fn set_len(&mut self, len: usize)
1.0.0Sets the length of a vector.
@@ -174,11 +224,38 @@ effect. modifying its buffers, so it is up to the caller to ensure that the vector is actually the specified size. -Examples
+Examples
-let mut v = vec![1, 2, 3, 4]; +use std::ptr; + +let mut vec = vec!['r', 'u', 's', 't']; + unsafe { - v.set_len(1); + ptr::drop_in_place(&mut vec[3]); + vec.set_len(3); +} +assert_eq!(vec, ['r', 'u', 's']);+ +In this example, there is a memory leak since the memory locations +owned by the inner vectors were not freed prior to the
+ +set_len
call:+let mut vec = vec![vec![1, 0, 0], + vec![0, 1, 0], + vec![0, 0, 1]]; +unsafe { + vec.set_len(0); +}+ +In this example, the vector gets expanded from zero to four items +without any memory allocations occurring, resulting in vector +values of unallocated memory:
+ ++let mut vec: Vec<char> = Vec::new(); + +unsafe { + vec.set_len(4); }
fn swap_remove(&mut self, index: usize) -> T
1.0.0Removes an element from anywhere in the vector and return it, replacing @@ -189,7 +266,7 @@ it with the last element.
Panics
Panics if
-index
is out of bounds.Examples
+Examples
let mut v = vec!["foo", "bar", "baz", "qux"]; @@ -205,7 +282,7 @@ elements after it to the right.Panics
Panics if
-index
is greater than the vector's length.Examples
+Examples
let mut vec = vec![1, 2, 3]; vec.insert(1, 4); @@ -219,7 +296,7 @@ shifting all elements after it to the left.Panics
Panics if
-index
is out of bounds.Examples
+Examples
let mut v = vec![1, 2, 3]; assert_eq!(v.remove(1), 2); @@ -231,7 +308,7 @@ shifting all elements after it to the left. This method operates in place and preserves the order of the retained elements. -Examples
+Examples
let mut vec = vec![1, 2, 3, 4]; vec.retain(|&x| x%2 == 0); @@ -242,7 +319,7 @@ elements.Panics
Panics if the number of elements in the vector overflows a
-usize
.Examples
+Examples
let mut vec = vec![1, 2]; vec.push(3); @@ -251,7 +328,7 @@ elements.Removes the last element from a vector and returns it, or
-None
if it is empty.Examples
+Examples
let mut vec = vec![1, 2, 3]; assert_eq!(vec.pop(), Some(3)); @@ -262,7 +339,7 @@ is empty.Panics
Panics if the number of elements in the vector overflows a
-usize
.Examples
+Examples
let mut vec = vec![1, 2, 3]; let mut vec2 = vec![4, 5, 6]; @@ -283,7 +360,7 @@ if theDrain
value is leaked.Panics if the starting point is greater than the end point or if the end point is greater than the length of the vector.
-Examples
+Examples
let mut v = vec![1, 2, 3]; let u: Vec<_> = v.drain(1..).collect(); @@ -296,7 +373,7 @@ the end point is greater than the length of the vector.
fn clear(&mut self)
1.0.0Clears the vector, removing all values.
-Examples
+Examples
let mut v = vec![1, 2, 3]; @@ -306,14 +383,14 @@ the end point is greater than the length of the vector.
fn len(&self) -> usize
1.0.0Returns the number of elements in the vector.
-Examples
+Examples
let a = vec![1, 2, 3]; assert_eq!(a.len(), 3);
fn is_empty(&self) -> bool
1.0.0Returns
-true
if the vector contains no elements.Examples
+Examples
let mut v = Vec::new(); assert!(v.is_empty()); @@ -331,7 +408,7 @@ and the returnedSelf
contains elements[at, len)
.Panics
Panics if
-at > len
.Examples
+Examples
let mut vec = vec![1,2,3]; let vec2 = vec.split_off(1); @@ -344,7 +421,7 @@ and the returnedSelf
contains elements[at, len)
. difference, with each additional slot filled withvalue
. Ifnew_len
is less thanlen()
, theVec
is simply truncated. -Examples
+Examples
let mut vec = vec!["hello"]; vec.resize(3, "world"); @@ -364,7 +441,7 @@ specialized to work with slices instead. If and when Rust gets specialization this function will likely be deprecated (but still available). -Examples
+Examples
let mut vec = vec![1]; vec.extend_from_slice(&[2, 3, 4]); @@ -374,7 +451,7 @@ available).If the vector is sorted, this removes all duplicates.
-Examples
+Examples
let mut vec = vec![1, 2, 2, 3, 2]; diff --git a/iron/headers/struct.ContentEncoding.html b/iron/headers/struct.ContentEncoding.html index 24a7d047..70ca372a 100644 --- a/iron/headers/struct.ContentEncoding.html +++ b/iron/headers/struct.ContentEncoding.html @@ -142,25 +142,75 @@ may still inform the vector that there is space for a few more elements.Note that this will drop any excess capacity. Calling this and converting back to a vector with
+ +into_vec()
is equivalent to callingshrink_to_fit()
.Examples
++let v = vec![1, 2, 3]; + +let slice = v.into_boxed_slice();+ +Any excess capacity is removed:
+ ++let mut vec = Vec::with_capacity(10); +vec.extend([1, 2, 3].iter().cloned()); + +assert_eq!(vec.capacity(), 10); +let slice = vec.into_boxed_slice(); +assert_eq!(slice.into_vec().capacity(), 3);-
fn truncate(&mut self, len: usize)
1.0.0Shorten a vector to be
+len
elements long, dropping excess elements.Shortens the vector, keeping the first
len
elements and dropping +the rest.If
-len
is greater than the vector's current length, this has no effect.Examples
+The
+ +drain
method can emulatetruncate
, but causes the excess +elements to be returned instead of dropped.Examples
+Truncating a five element vector to two elements:
+let mut vec = vec![1, 2, 3, 4, 5]; vec.truncate(2); assert_eq!(vec, [1, 2]);+ +No truncation occurs when
+ +len
is greater than the vector's current +length:+let mut vec = vec![1, 2, 3]; +vec.truncate(8); +assert_eq!(vec, [1, 2, 3]);+ +Truncating when
+ +len == 0
is equivalent to calling theclear
+method.+let mut vec = vec![1, 2, 3]; +vec.truncate(0); +assert_eq!(vec, []);
fn as_slice(&self) -> &[T]
1.7.0Extracts a slice containing the entire vector.
Equivalent to
+ +&s[..]
.Examples
++use std::io::{self, Write}; +let buffer = vec![1, 2, 3, 5, 8]; +io::sink().write(buffer.as_slice()).unwrap();
fn as_mut_slice(&mut self) -> &mut [T]
1.7.0Extracts a mutable slice of the entire vector.
Equivalent to
+ +&mut s[..]
.Examples
++use std::io::{self, Read}; +let mut buffer = vec![0; 3]; +io::repeat(0b101).read_exact(buffer.as_mut_slice()).unwrap();
unsafe fn set_len(&mut self, len: usize)
1.0.0Sets the length of a vector.
@@ -168,11 +218,38 @@ effect. modifying its buffers, so it is up to the caller to ensure that the vector is actually the specified size. -Examples
+Examples
-let mut v = vec![1, 2, 3, 4]; +use std::ptr; + +let mut vec = vec!['r', 'u', 's', 't']; + unsafe { - v.set_len(1); + ptr::drop_in_place(&mut vec[3]); + vec.set_len(3); +} +assert_eq!(vec, ['r', 'u', 's']);+ +In this example, there is a memory leak since the memory locations +owned by the inner vectors were not freed prior to the
+ +set_len
call:+let mut vec = vec![vec![1, 0, 0], + vec![0, 1, 0], + vec![0, 0, 1]]; +unsafe { + vec.set_len(0); +}+ +In this example, the vector gets expanded from zero to four items +without any memory allocations occurring, resulting in vector +values of unallocated memory:
+ ++let mut vec: Vec<char> = Vec::new(); + +unsafe { + vec.set_len(4); }
fn swap_remove(&mut self, index: usize) -> T
1.0.0Removes an element from anywhere in the vector and return it, replacing @@ -183,7 +260,7 @@ it with the last element.
Panics
Panics if
-index
is out of bounds.Examples
+Examples
let mut v = vec!["foo", "bar", "baz", "qux"]; @@ -199,7 +276,7 @@ elements after it to the right.Panics
Panics if
-index
is greater than the vector's length.Examples
+Examples
let mut vec = vec![1, 2, 3]; vec.insert(1, 4); @@ -213,7 +290,7 @@ shifting all elements after it to the left.Panics
Panics if
-index
is out of bounds.Examples
+Examples
let mut v = vec![1, 2, 3]; assert_eq!(v.remove(1), 2); @@ -225,7 +302,7 @@ shifting all elements after it to the left. This method operates in place and preserves the order of the retained elements. -Examples
+Examples
let mut vec = vec![1, 2, 3, 4]; vec.retain(|&x| x%2 == 0); @@ -236,7 +313,7 @@ elements.Panics
Panics if the number of elements in the vector overflows a
-usize
.Examples
+Examples
let mut vec = vec![1, 2]; vec.push(3); @@ -245,7 +322,7 @@ elements.Removes the last element from a vector and returns it, or
-None
if it is empty.Examples
+Examples
let mut vec = vec![1, 2, 3]; assert_eq!(vec.pop(), Some(3)); @@ -256,7 +333,7 @@ is empty.Panics
Panics if the number of elements in the vector overflows a
-usize
.Examples
+Examples
let mut vec = vec![1, 2, 3]; let mut vec2 = vec![4, 5, 6]; @@ -277,7 +354,7 @@ if theDrain
value is leaked.Panics if the starting point is greater than the end point or if the end point is greater than the length of the vector.
-Examples
+Examples
let mut v = vec![1, 2, 3]; let u: Vec<_> = v.drain(1..).collect(); @@ -290,7 +367,7 @@ the end point is greater than the length of the vector.
fn clear(&mut self)
1.0.0Clears the vector, removing all values.
-Examples
+Examples
let mut v = vec![1, 2, 3]; @@ -300,14 +377,14 @@ the end point is greater than the length of the vector.
fn len(&self) -> usize
1.0.0Returns the number of elements in the vector.
-Examples
+Examples
let a = vec![1, 2, 3]; assert_eq!(a.len(), 3);
fn is_empty(&self) -> bool
1.0.0Returns
-true
if the vector contains no elements.Examples
+Examples
let mut v = Vec::new(); assert!(v.is_empty()); @@ -325,7 +402,7 @@ and the returnedSelf
contains elements[at, len)
.Panics
Panics if
-at > len
.Examples
+Examples
let mut vec = vec![1,2,3]; let vec2 = vec.split_off(1); @@ -338,7 +415,7 @@ and the returnedSelf
contains elements[at, len)
. difference, with each additional slot filled withvalue
. Ifnew_len
is less thanlen()
, theVec
is simply truncated. -Examples
+Examples
let mut vec = vec!["hello"]; vec.resize(3, "world"); @@ -358,7 +435,7 @@ specialized to work with slices instead. If and when Rust gets specialization this function will likely be deprecated (but still available). -Examples
+Examples
let mut vec = vec![1]; vec.extend_from_slice(&[2, 3, 4]); @@ -368,7 +445,7 @@ available).If the vector is sorted, this removes all duplicates.
-Examples
+Examples
let mut vec = vec![1, 2, 2, 3, 2]; diff --git a/iron/headers/struct.ContentLanguage.html b/iron/headers/struct.ContentLanguage.html index 8cca1483..91bbb080 100644 --- a/iron/headers/struct.ContentLanguage.html +++ b/iron/headers/struct.ContentLanguage.html @@ -141,25 +141,75 @@ may still inform the vector that there is space for a few more elements.Note that this will drop any excess capacity. Calling this and converting back to a vector with
+ +into_vec()
is equivalent to callingshrink_to_fit()
.Examples
++let v = vec![1, 2, 3]; + +let slice = v.into_boxed_slice();+ +Any excess capacity is removed:
+ ++let mut vec = Vec::with_capacity(10); +vec.extend([1, 2, 3].iter().cloned()); + +assert_eq!(vec.capacity(), 10); +let slice = vec.into_boxed_slice(); +assert_eq!(slice.into_vec().capacity(), 3);-
fn truncate(&mut self, len: usize)
1.0.0Shorten a vector to be
+len
elements long, dropping excess elements.Shortens the vector, keeping the first
len
elements and dropping +the rest.If
-len
is greater than the vector's current length, this has no effect.Examples
+The
+ +drain
method can emulatetruncate
, but causes the excess +elements to be returned instead of dropped.Examples
+Truncating a five element vector to two elements:
+let mut vec = vec![1, 2, 3, 4, 5]; vec.truncate(2); assert_eq!(vec, [1, 2]);+ +No truncation occurs when
+ +len
is greater than the vector's current +length:+let mut vec = vec![1, 2, 3]; +vec.truncate(8); +assert_eq!(vec, [1, 2, 3]);+ +Truncating when
+ +len == 0
is equivalent to calling theclear
+method.+let mut vec = vec![1, 2, 3]; +vec.truncate(0); +assert_eq!(vec, []);
fn as_slice(&self) -> &[T]
1.7.0Extracts a slice containing the entire vector.
Equivalent to
+ +&s[..]
.Examples
++use std::io::{self, Write}; +let buffer = vec![1, 2, 3, 5, 8]; +io::sink().write(buffer.as_slice()).unwrap();
fn as_mut_slice(&mut self) -> &mut [T]
1.7.0Extracts a mutable slice of the entire vector.
Equivalent to
+ +&mut s[..]
.Examples
++use std::io::{self, Read}; +let mut buffer = vec![0; 3]; +io::repeat(0b101).read_exact(buffer.as_mut_slice()).unwrap();
unsafe fn set_len(&mut self, len: usize)
1.0.0Sets the length of a vector.
@@ -167,11 +217,38 @@ effect. modifying its buffers, so it is up to the caller to ensure that the vector is actually the specified size. -Examples
+Examples
-let mut v = vec![1, 2, 3, 4]; +use std::ptr; + +let mut vec = vec!['r', 'u', 's', 't']; + unsafe { - v.set_len(1); + ptr::drop_in_place(&mut vec[3]); + vec.set_len(3); +} +assert_eq!(vec, ['r', 'u', 's']);+ +In this example, there is a memory leak since the memory locations +owned by the inner vectors were not freed prior to the
+ +set_len
call:+let mut vec = vec![vec![1, 0, 0], + vec![0, 1, 0], + vec![0, 0, 1]]; +unsafe { + vec.set_len(0); +}+ +In this example, the vector gets expanded from zero to four items +without any memory allocations occurring, resulting in vector +values of unallocated memory:
+ ++let mut vec: Vec<char> = Vec::new(); + +unsafe { + vec.set_len(4); }
fn swap_remove(&mut self, index: usize) -> T
1.0.0Removes an element from anywhere in the vector and return it, replacing @@ -182,7 +259,7 @@ it with the last element.
Panics
Panics if
-index
is out of bounds.Examples
+Examples
let mut v = vec!["foo", "bar", "baz", "qux"]; @@ -198,7 +275,7 @@ elements after it to the right.Panics
Panics if
-index
is greater than the vector's length.Examples
+Examples
let mut vec = vec![1, 2, 3]; vec.insert(1, 4); @@ -212,7 +289,7 @@ shifting all elements after it to the left.Panics
Panics if
-index
is out of bounds.Examples
+Examples
let mut v = vec![1, 2, 3]; assert_eq!(v.remove(1), 2); @@ -224,7 +301,7 @@ shifting all elements after it to the left. This method operates in place and preserves the order of the retained elements. -Examples
+Examples
let mut vec = vec![1, 2, 3, 4]; vec.retain(|&x| x%2 == 0); @@ -235,7 +312,7 @@ elements.Panics
Panics if the number of elements in the vector overflows a
-usize
.Examples
+Examples
let mut vec = vec![1, 2]; vec.push(3); @@ -244,7 +321,7 @@ elements.+Removes the last element from a vector and returns it, or
-None
if it is empty.Examples
+Examples
let mut vec = vec![1, 2, 3]; assert_eq!(vec.pop(), Some(3)); @@ -255,7 +332,7 @@ is empty.Panics
Panics if the number of elements in the vector overflows a
-usize
.Examples
+Examples
let mut vec = vec![1, 2, 3]; let mut vec2 = vec![4, 5, 6]; @@ -276,7 +353,7 @@ if theDrain
value is leaked.Panics if the starting point is greater than the end point or if the end point is greater than the length of the vector.
-Examples
+Examples
let mut v = vec![1, 2, 3]; let u: Vec<_> = v.drain(1..).collect(); @@ -289,7 +366,7 @@ the end point is greater than the length of the vector.
fn clear(&mut self)
1.0.0Clears the vector, removing all values.
-Examples
+Examples
let mut v = vec![1, 2, 3]; @@ -299,14 +376,14 @@ the end point is greater than the length of the vector.
fn len(&self) -> usize
1.0.0Returns the number of elements in the vector.
-Examples
+Examples
let a = vec![1, 2, 3]; assert_eq!(a.len(), 3);
fn is_empty(&self) -> bool
1.0.0Returns
-true
if the vector contains no elements.Examples
+Examples
let mut v = Vec::new(); assert!(v.is_empty()); @@ -324,7 +401,7 @@ and the returnedSelf
contains elements[at, len)
.Panics
Panics if
-at > len
.Examples
+Examples
let mut vec = vec![1,2,3]; let vec2 = vec.split_off(1); @@ -337,7 +414,7 @@ and the returnedSelf
contains elements[at, len)
. difference, with each additional slot filled withvalue
. Ifnew_len
is less thanlen()
, theVec
is simply truncated. -Examples
+Examples
let mut vec = vec!["hello"]; vec.resize(3, "world"); @@ -357,7 +434,7 @@ specialized to work with slices instead. If and when Rust gets specialization this function will likely be deprecated (but still available). -Examples
+Examples
let mut vec = vec![1]; vec.extend_from_slice(&[2, 3, 4]); @@ -367,7 +444,7 @@ available).If the vector is sorted, this removes all duplicates.
-Examples
+Examples
let mut vec = vec![1, 2, 2, 3, 2]; diff --git a/iron/headers/struct.ContentLength.html b/iron/headers/struct.ContentLength.html index 53b3f2c6..eb1cffcc 100644 --- a/iron/headers/struct.ContentLength.html +++ b/iron/headers/struct.ContentLength.html @@ -121,6 +121,8 @@ ofself
.Shifts the bits to the left by a specified amount,
+n
, wrapping the truncated bits to the end of the resulting integer.Please note this isn't the same operation as
+<<
!Examples
Basic usage:
@@ -134,6 +136,8 @@ wrapping the truncated bits to the end of the resulting integer. wrapping the truncated bits to the beginning of the resulting integer. +Please note this isn't the same operation as
+>>
!Examples
Basic usage:
diff --git a/iron/headers/struct.Cookie.html b/iron/headers/struct.Cookie.html index 10bcaa93..5209e707 100644 --- a/iron/headers/struct.Cookie.html +++ b/iron/headers/struct.Cookie.html @@ -47,360 +47,50 @@ [−] - [src] -pub struct Cookie(pub Vec<Cookie>);- -
Cookie
header, defined in RFC6265If the user agent does attach a Cookie header field to an HTTP -request, the user agent must send the cookie-string -as the value of the header field.
- -When the user agent generates an HTTP request, the user agent MUST NOT -attach more than one Cookie header field.
- -Example values
--
- -- -
SID=31d4d96e407aad42
- -
SID=31d4d96e407aad42; lang=en-US
Example
--use hyper::header::{Headers, Cookie}; -use cookie::Cookie as CookiePair; - -let mut headers = Headers::new(); - -headers.set( - Cookie(vec![ - CookiePair::new("foo".to_owned(), "bar".to_owned()) - ]) -);-Methods
-
impl Cookie
-
fn to_cookie_jar(&self, key: &[u8]) -> CookieJar<'static>
This method can be used to create CookieJar that can be used -to manipulate cookies and create a corresponding
-SetCookie
header afterwards.-
fn from_cookie_jar(jar: &CookieJar) -> Cookie
Extracts all cookies from
-CookieJar
and creates Cookie header. -Useful for clients.Methods from Deref<Target=Vec<Cookie>>
-
fn capacity(&self) -> usize
1.0.0Returns the number of elements the vector can hold without -reallocating.
- -Examples
--let vec: Vec<i32> = Vec::with_capacity(10); -assert_eq!(vec.capacity(), 10);--
fn reserve(&mut self, additional: usize)
1.0.0Reserves capacity for at least
- -additional
more elements to be inserted -in the givenVec<T>
. The collection may reserve more space to avoid -frequent reallocations.Panics
-Panics if the new capacity overflows
- -usize
.Examples
--let mut vec = vec![1]; -vec.reserve(10); -assert!(vec.capacity() >= 11);--
fn reserve_exact(&mut self, additional: usize)
1.0.0Reserves the minimum capacity for exactly
- -additional
more elements to -be inserted in the givenVec<T>
. Does nothing if the capacity is already -sufficient.Note that the allocator may give the collection more space than it -requests. Therefore capacity can not be relied upon to be precisely -minimal. Prefer
- -reserve
if future insertions are expected.Panics
-Panics if the new capacity overflows
- -usize
.Examples
--let mut vec = vec![1]; -vec.reserve_exact(10); -assert!(vec.capacity() >= 11);--
fn shrink_to_fit(&mut self)
1.0.0Shrinks the capacity of the vector as much as possible.
- -It will drop down as close as possible to the length but the allocator -may still inform the vector that there is space for a few more elements.
- -Examples
--let mut vec = Vec::with_capacity(10); -vec.extend([1, 2, 3].iter().cloned()); -assert_eq!(vec.capacity(), 10); -vec.shrink_to_fit(); -assert!(vec.capacity() >= 3);--
fn into_boxed_slice(self) -> Box<[T]>
1.0.0Converts the vector into Box<[T]>.
- -Note that this will drop any excess capacity. Calling this and -converting back to a vector with
-into_vec()
is equivalent to calling -shrink_to_fit()
.-
fn truncate(&mut self, len: usize)
1.0.0Shorten a vector to be
- -len
elements long, dropping excess elements.If
- -len
is greater than the vector's current length, this has no -effect.Examples
--let mut vec = vec![1, 2, 3, 4, 5]; -vec.truncate(2); -assert_eq!(vec, [1, 2]);--
fn as_slice(&self) -> &[T]
1.7.0Extracts a slice containing the entire vector.
- -Equivalent to
-&s[..]
.-
fn as_mut_slice(&mut self) -> &mut [T]
1.7.0Extracts a mutable slice of the entire vector.
- -Equivalent to
-&mut s[..]
.-
unsafe fn set_len(&mut self, len: usize)
1.0.0Sets the length of a vector.
- -This will explicitly set the size of the vector, without actually -modifying its buffers, so it is up to the caller to ensure that the -vector is actually the specified size.
- -Examples
--let mut v = vec![1, 2, 3, 4]; -unsafe { - v.set_len(1); -}--
fn swap_remove(&mut self, index: usize) -> T
1.0.0Removes an element from anywhere in the vector and return it, replacing -it with the last element.
- -This does not preserve ordering, but is O(1).
- -Panics
-Panics if
- -index
is out of bounds.Examples
--let mut v = vec!["foo", "bar", "baz", "qux"]; - -assert_eq!(v.swap_remove(1), "bar"); -assert_eq!(v, ["foo", "qux", "baz"]); - -assert_eq!(v.swap_remove(0), "foo"); -assert_eq!(v, ["baz", "qux"]);--
fn insert(&mut self, index: usize, element: T)
1.0.0Inserts an element at position
- -index
within the vector, shifting all -elements after it to the right.Panics
-Panics if
- -index
is greater than the vector's length.Examples
--let mut vec = vec![1, 2, 3]; -vec.insert(1, 4); -assert_eq!(vec, [1, 4, 2, 3]); -vec.insert(4, 5); -assert_eq!(vec, [1, 4, 2, 3, 5]);--
fn remove(&mut self, index: usize) -> T
1.0.0Removes and returns the element at position
- -index
within the vector, -shifting all elements after it to the left.Panics
-Panics if
- -index
is out of bounds.Examples
--let mut v = vec![1, 2, 3]; -assert_eq!(v.remove(1), 2); -assert_eq!(v, [1, 3]);--
fn retain<F>(&mut self, f: F) where F: FnMut(&T) -> bool
1.0.0Retains only the elements specified by the predicate.
- -In other words, remove all elements
- -e
such thatf(&e)
returns false. -This method operates in place and preserves the order of the retained -elements.Examples
--let mut vec = vec![1, 2, 3, 4]; -vec.retain(|&x| x%2 == 0); -assert_eq!(vec, [2, 4]);--
fn push(&mut self, value: T)
1.0.0Appends an element to the back of a collection.
- -Panics
-Panics if the number of elements in the vector overflows a
- -usize
.Examples
--let mut vec = vec![1, 2]; -vec.push(3); -assert_eq!(vec, [1, 2, 3]);--
fn pop(&mut self) -> Option<T>
1.0.0Removes the last element from a vector and returns it, or
- -None
if it -is empty.Examples
--let mut vec = vec![1, 2, 3]; -assert_eq!(vec.pop(), Some(3)); -assert_eq!(vec, [1, 2]);--
fn append(&mut self, other: &mut Vec<T>)
1.4.0Moves all the elements of
- -other
intoSelf
, leavingother
empty.Panics
-Panics if the number of elements in the vector overflows a
- -usize
.Examples
--let mut vec = vec![1, 2, 3]; -let mut vec2 = vec![4, 5, 6]; -vec.append(&mut vec2); -assert_eq!(vec, [1, 2, 3, 4, 5, 6]); -assert_eq!(vec2, []);--
fn drain<R>(&mut self, range: R) -> Drain<T> where R: RangeArgument<usize>
1.6.0Create a draining iterator that removes the specified range in the vector -and yields the removed items.
- -Note 1: The element range is removed even if the iterator is not -consumed until the end.
- -Note 2: It is unspecified how many elements are removed from the vector, -if the
- -Drain
value is leaked.Panics
-Panics if the starting point is greater than the end point or if -the end point is greater than the length of the vector.
- -Examples
--let mut v = vec![1, 2, 3]; -let u: Vec<_> = v.drain(1..).collect(); -assert_eq!(v, &[1]); -assert_eq!(u, &[2, 3]); - -// A full range clears the vector -v.drain(..); -assert_eq!(v, &[]);--
fn clear(&mut self)
1.0.0Clears the vector, removing all values.
- -Examples
--let mut v = vec![1, 2, 3]; - -v.clear(); - -assert!(v.is_empty());--
fn len(&self) -> usize
1.0.0Returns the number of elements in the vector.
- -Examples
--let a = vec![1, 2, 3]; -assert_eq!(a.len(), 3);--
fn is_empty(&self) -> bool
1.0.0Returns
- -true
if the vector contains no elements.Examples
--let mut v = Vec::new(); -assert!(v.is_empty()); - -v.push(1); -assert!(!v.is_empty());--
fn split_off(&mut self, at: usize) -> Vec<T>
1.4.0Splits the collection into two at the given index.
- -Returns a newly allocated
- -Self
.self
contains elements[0, at)
, -and the returnedSelf
contains elements[at, len)
.Note that the capacity of
- -self
does not change.Panics
-Panics if
- -at > len
.Examples
--let mut vec = vec![1,2,3]; -let vec2 = vec.split_off(1); -assert_eq!(vec, [1]); -assert_eq!(vec2, [2, 3]);--
fn resize(&mut self, new_len: usize, value: T)
1.5.0Resizes the
- -Vec
in-place so thatlen()
is equal tonew_len
.If
- -new_len
is greater thanlen()
, theVec
is extended by the -difference, with each additional slot filled withvalue
. -Ifnew_len
is less thanlen()
, theVec
is simply truncated.Examples
--let mut vec = vec!["hello"]; -vec.resize(3, "world"); -assert_eq!(vec, ["hello", "world", "world"]); - -let mut vec = vec![1, 2, 3, 4]; -vec.resize(2, 0); -assert_eq!(vec, [1, 2]);--
fn extend_from_slice(&mut self, other: &[T])
1.6.0Clones and appends all elements in a slice to the
- -Vec
.Iterates over the slice
- -other
, clones each element, and then appends -it to thisVec
. Theother
vector is traversed in-order.Note that this function is same as
- -extend
except that it is -specialized to work with slices instead. If and when Rust gets -specialization this function will likely be deprecated (but still -available).Examples
--let mut vec = vec![1]; -vec.extend_from_slice(&[2, 3, 4]); -assert_eq!(vec, [1, 2, 3, 4]);--
fn dedup(&mut self)
1.0.0Removes consecutive repeated elements in the vector.
- -If the vector is sorted, this removes all duplicates.
- -Examples
--let mut vec = vec![1, 2, 2, 3, 2]; - -vec.dedup(); - -assert_eq!(vec, [1, 2, 3, 2]);-Trait Implementations
+ [src] +
impl Debug for Cookie
pub struct Cookie { + pub name: String, + pub value: String, + pub expires: Option<Tm>, + pub max_age: Option<u64>, + pub domain: Option<String>, + pub path: Option<String>, + pub secure: bool, + pub httponly: bool, + pub custom: BTreeMap<String, String>, +}Fields
name: String
+value: String
+expires: Option<Tm>
+max_age: Option<u64>
+domain: Option<String>
+path: Option<String>
+secure: bool
+httponly: bool
+custom: BTreeMap<String, String>
+Methods
+
impl Cookie
+
fn new(name: String, value: String) -> Cookie
+
fn parse(s: &str) -> Result<Cookie, ()>
+
fn pair(&self) -> AttrVal
Trait Implementations
impl Debug for Cookie
fn fmt(&self, __arg_0: &mut Formatter) -> Result<(), Error>
Formats the value using the given formatter.
--
impl PartialEq<Cookie> for Cookie
-
fn eq(&self, __arg_0: &Cookie) -> bool
This method tests for
-self
andother
values to be equal, and is used by==
. Read more-
fn ne(&self, __arg_0: &Cookie) -> bool
This method tests for
!=
.
impl Clone for Cookie
fn clone(&self) -> Cookie
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0Performs copy-assignment from
-source
. Read more-
impl Deref for Cookie
-
type Target = Vec<Cookie>
The resulting type after dereferencing
--
fn deref(&self) -> &Vec<Cookie>
The method called to dereference a value
--
impl DerefMut for Cookie
-
impl Header for Cookie
-
fn header_name() -> &'static str
Returns the name of the header field this belongs to. Read more
--
fn parse_header(raw: &[Vec<u8>]) -> Result<Cookie, Error>
Parse a header from a raw stream of bytes. Read more
-- +
impl HeaderFormat for Cookie
+
impl PartialEq<Cookie> for Cookie
+
fn eq(&self, __arg_0: &Cookie) -> bool
This method tests for
+self
andother
values to be equal, and is used by==
. Read more+
fn ne(&self, __arg_0: &Cookie) -> bool
This method tests for
+!=
.+
impl Display for Cookie
+
fn fmt(&self, f: &mut Formatter) -> Result<(), Error>
Formats the value using the given formatter.
++ diff --git a/iron/headers/struct.From.html b/iron/headers/struct.From.html index 198784da..7f3daa94 100644 --- a/iron/headers/struct.From.html +++ b/iron/headers/struct.From.html @@ -291,6 +291,28 @@ lie on a
impl FromStr for Cookie
char
boundary. s.insert(2, 'o'); assert_eq!("foo", s);+
fn insert_str(&mut self, idx: usize, string: &str)
Unstable (insert_str
): recent addition
+Inserts a string slice into this
+ +String
at a byte position.This is an
+ +O(n)
operation as it requires copying every element in the +buffer.Panics
+Panics if
+ +idx
is larger than theString
's length, or if it does not +lie on achar
boundary.Examples
+Basic usage:
+ ++#![feature(insert_str)] + +let mut s = String::from("bar"); + +s.insert_str(0, "foo"); + +assert_eq!("foobar", s);
unsafe fn as_mut_vec(&mut self) -> &mut Vec<u8>
1.0.0Returns a mutable reference to the contents of this
@@ -300,7 +322,7 @@ to it are valid UTF-8. If this constraint is violated, it may cause memory unsafety issues with future users of theString
.String
, as the rest of the standard library assumes thatString
s are valid UTF-8. -Examples
+Examples
Basic usage:
@@ -316,7 +338,7 @@ the standard library assumes thatString
s are valid UTF-8.
fn len(&self) -> usize
1.0.0Returns the length of this
-String
, in bytes.Examples
+Examples
Basic usage:
@@ -328,7 +350,7 @@ the standard library assumes thatString
s are valid UTF-8.Returns
-false
otherwise.Examples
+Examples
Basic usage:
@@ -343,7 +365,7 @@ the standard library assumes thatString
s are valid UTF-8.While this means the
-String
will have a length of zero, it does not touch its capacity.Examples
+Examples
Basic usage:
@@ -361,11 +383,11 @@ and yields the removed chars.Note: The element range is removed even if the iterator is not consumed until the end.
-Panics
+Panics
Panics if the starting point or end point do not lie on a
-char
boundary, or if they're out of bounds.Examples
+Examples
Basic usage:
@@ -385,7 +407,7 @@ boundary, or if they're out of bounds.This will drop any excess capacity.
-Examples
+Examples
Basic usage:
diff --git a/iron/headers/struct.HeaderFormatter.html b/iron/headers/struct.HeaderFormatter.html index 5354a504..c586c307 100644 --- a/iron/headers/struct.HeaderFormatter.html +++ b/iron/headers/struct.HeaderFormatter.html @@ -48,7 +48,7 @@ [−] [src] -pub struct HeaderFormatter<'a, H> where H: HeaderFormat(pub &'a H);
A wrapper around any Header with a Display impl that calls fmt_header.
+pub struct HeaderFormatter<'a, H>(pub &'a H) where H: HeaderFormat;
A wrapper around any Header with a Display impl that calls fmt_header.
This can be used like so:
format!("{}", HeaderFormatter(&header))
to get the representation of a Header which will be written to an diff --git a/iron/headers/struct.Location.html b/iron/headers/struct.Location.html index 292b7351..107d5085 100644 --- a/iron/headers/struct.Location.html +++ b/iron/headers/struct.Location.html @@ -304,6 +304,28 @@ lie on achar
boundary. s.insert(2, 'o'); assert_eq!("foo", s); ++
fn insert_str(&mut self, idx: usize, string: &str)
Unstable (insert_str
): recent addition
+Inserts a string slice into this
+ +String
at a byte position.This is an
+ +O(n)
operation as it requires copying every element in the +buffer.Panics
+Panics if
+ +idx
is larger than theString
's length, or if it does not +lie on achar
boundary.Examples
+Basic usage:
+ ++#![feature(insert_str)] + +let mut s = String::from("bar"); + +s.insert_str(0, "foo"); + +assert_eq!("foobar", s);
unsafe fn as_mut_vec(&mut self) -> &mut Vec<u8>
1.0.0Returns a mutable reference to the contents of this
@@ -313,7 +335,7 @@ to it are valid UTF-8. If this constraint is violated, it may cause memory unsafety issues with future users of theString
.String
, as the rest of the standard library assumes thatString
s are valid UTF-8. -Examples
+Examples
Basic usage:
@@ -329,7 +351,7 @@ the standard library assumes thatString
s are valid UTF-8.
fn len(&self) -> usize
1.0.0Returns the length of this
-String
, in bytes.Examples
+Examples
Basic usage:
@@ -341,7 +363,7 @@ the standard library assumes thatString
s are valid UTF-8.Returns
-false
otherwise.Examples
+Examples
Basic usage:
@@ -356,7 +378,7 @@ the standard library assumes thatString
s are valid UTF-8.While this means the
-String
will have a length of zero, it does not touch its capacity.Examples
+Examples
Basic usage:
@@ -374,11 +396,11 @@ and yields the removed chars.Note: The element range is removed even if the iterator is not consumed until the end.
-Panics
+Panics
Panics if the starting point or end point do not lie on a
-char
boundary, or if they're out of bounds.Examples
+Examples
Basic usage:
@@ -398,7 +420,7 @@ boundary, or if they're out of bounds.This will drop any excess capacity.
-Examples
+Examples
Basic usage:
diff --git a/iron/headers/struct.Prefer.html b/iron/headers/struct.Prefer.html index 62d0930e..f2d886b1 100644 --- a/iron/headers/struct.Prefer.html +++ b/iron/headers/struct.Prefer.html @@ -148,25 +148,75 @@ may still inform the vector that there is space for a few more elements.Note that this will drop any excess capacity. Calling this and converting back to a vector with
+ +into_vec()
is equivalent to callingshrink_to_fit()
.Examples
++let v = vec![1, 2, 3]; + +let slice = v.into_boxed_slice();+ +Any excess capacity is removed:
+ ++let mut vec = Vec::with_capacity(10); +vec.extend([1, 2, 3].iter().cloned()); + +assert_eq!(vec.capacity(), 10); +let slice = vec.into_boxed_slice(); +assert_eq!(slice.into_vec().capacity(), 3);-
fn truncate(&mut self, len: usize)
1.0.0Shorten a vector to be
+len
elements long, dropping excess elements.Shortens the vector, keeping the first
len
elements and dropping +the rest.If
-len
is greater than the vector's current length, this has no effect.Examples
+The
+ +drain
method can emulatetruncate
, but causes the excess +elements to be returned instead of dropped.Examples
+Truncating a five element vector to two elements:
+let mut vec = vec![1, 2, 3, 4, 5]; vec.truncate(2); assert_eq!(vec, [1, 2]);+ +No truncation occurs when
+ +len
is greater than the vector's current +length:+let mut vec = vec![1, 2, 3]; +vec.truncate(8); +assert_eq!(vec, [1, 2, 3]);+ +Truncating when
+ +len == 0
is equivalent to calling theclear
+method.+let mut vec = vec![1, 2, 3]; +vec.truncate(0); +assert_eq!(vec, []);
fn as_slice(&self) -> &[T]
1.7.0Extracts a slice containing the entire vector.
Equivalent to
+ +&s[..]
.Examples
++use std::io::{self, Write}; +let buffer = vec![1, 2, 3, 5, 8]; +io::sink().write(buffer.as_slice()).unwrap();
fn as_mut_slice(&mut self) -> &mut [T]
1.7.0Extracts a mutable slice of the entire vector.
Equivalent to
+ +&mut s[..]
.Examples
++use std::io::{self, Read}; +let mut buffer = vec![0; 3]; +io::repeat(0b101).read_exact(buffer.as_mut_slice()).unwrap();
unsafe fn set_len(&mut self, len: usize)
1.0.0Sets the length of a vector.
@@ -174,11 +224,38 @@ effect. modifying its buffers, so it is up to the caller to ensure that the vector is actually the specified size. -Examples
+Examples
-let mut v = vec![1, 2, 3, 4]; +use std::ptr; + +let mut vec = vec!['r', 'u', 's', 't']; + unsafe { - v.set_len(1); + ptr::drop_in_place(&mut vec[3]); + vec.set_len(3); +} +assert_eq!(vec, ['r', 'u', 's']);+ +In this example, there is a memory leak since the memory locations +owned by the inner vectors were not freed prior to the
+ +set_len
call:+let mut vec = vec![vec![1, 0, 0], + vec![0, 1, 0], + vec![0, 0, 1]]; +unsafe { + vec.set_len(0); +}+ +In this example, the vector gets expanded from zero to four items +without any memory allocations occurring, resulting in vector +values of unallocated memory:
+ ++let mut vec: Vec<char> = Vec::new(); + +unsafe { + vec.set_len(4); }
fn swap_remove(&mut self, index: usize) -> T
1.0.0Removes an element from anywhere in the vector and return it, replacing @@ -189,7 +266,7 @@ it with the last element.
Panics
Panics if
-index
is out of bounds.Examples
+Examples
let mut v = vec!["foo", "bar", "baz", "qux"]; @@ -205,7 +282,7 @@ elements after it to the right.Panics
Panics if
-index
is greater than the vector's length.Examples
+Examples
let mut vec = vec![1, 2, 3]; vec.insert(1, 4); @@ -219,7 +296,7 @@ shifting all elements after it to the left.Panics
Panics if
-index
is out of bounds.Examples
+Examples
let mut v = vec![1, 2, 3]; assert_eq!(v.remove(1), 2); @@ -231,7 +308,7 @@ shifting all elements after it to the left. This method operates in place and preserves the order of the retained elements. -Examples
+Examples
let mut vec = vec![1, 2, 3, 4]; vec.retain(|&x| x%2 == 0); @@ -242,7 +319,7 @@ elements.Panics
Panics if the number of elements in the vector overflows a
-usize
.Examples
+Examples
let mut vec = vec![1, 2]; vec.push(3); @@ -251,7 +328,7 @@ elements.Removes the last element from a vector and returns it, or
-None
if it is empty.Examples
+Examples
let mut vec = vec![1, 2, 3]; assert_eq!(vec.pop(), Some(3)); @@ -262,7 +339,7 @@ is empty.Panics
Panics if the number of elements in the vector overflows a
-usize
.Examples
+Examples
let mut vec = vec![1, 2, 3]; let mut vec2 = vec![4, 5, 6]; @@ -283,7 +360,7 @@ if theDrain
value is leaked.Panics if the starting point is greater than the end point or if the end point is greater than the length of the vector.
-Examples
+Examples
let mut v = vec![1, 2, 3]; let u: Vec<_> = v.drain(1..).collect(); @@ -296,7 +373,7 @@ the end point is greater than the length of the vector.
fn clear(&mut self)
1.0.0Clears the vector, removing all values.
-Examples
+Examples
let mut v = vec![1, 2, 3]; @@ -306,14 +383,14 @@ the end point is greater than the length of the vector.
fn len(&self) -> usize
1.0.0Returns the number of elements in the vector.
-Examples
+Examples
let a = vec![1, 2, 3]; assert_eq!(a.len(), 3);
fn is_empty(&self) -> bool
1.0.0Returns
-true
if the vector contains no elements.Examples
+Examples
let mut v = Vec::new(); assert!(v.is_empty()); @@ -331,7 +408,7 @@ and the returnedSelf
contains elements[at, len)
.Panics
Panics if
-at > len
.Examples
+Examples
let mut vec = vec![1,2,3]; let vec2 = vec.split_off(1); @@ -344,7 +421,7 @@ and the returnedSelf
contains elements[at, len)
. difference, with each additional slot filled withvalue
. Ifnew_len
is less thanlen()
, theVec
is simply truncated. -Examples
+Examples
let mut vec = vec!["hello"]; vec.resize(3, "world"); @@ -364,7 +441,7 @@ specialized to work with slices instead. If and when Rust gets specialization this function will likely be deprecated (but still available). -Examples
+Examples
let mut vec = vec![1]; vec.extend_from_slice(&[2, 3, 4]); @@ -374,7 +451,7 @@ available).If the vector is sorted, this removes all duplicates.
-Examples
+Examples
let mut vec = vec![1, 2, 2, 3, 2]; diff --git a/iron/headers/struct.PreferenceApplied.html b/iron/headers/struct.PreferenceApplied.html index da58532d..b0c4bf60 100644 --- a/iron/headers/struct.PreferenceApplied.html +++ b/iron/headers/struct.PreferenceApplied.html @@ -146,25 +146,75 @@ may still inform the vector that there is space for a few more elements.Note that this will drop any excess capacity. Calling this and converting back to a vector with
+ +into_vec()
is equivalent to callingshrink_to_fit()
.Examples
++let v = vec![1, 2, 3]; + +let slice = v.into_boxed_slice();+ +Any excess capacity is removed:
+ ++let mut vec = Vec::with_capacity(10); +vec.extend([1, 2, 3].iter().cloned()); + +assert_eq!(vec.capacity(), 10); +let slice = vec.into_boxed_slice(); +assert_eq!(slice.into_vec().capacity(), 3);-
fn truncate(&mut self, len: usize)
1.0.0Shorten a vector to be
+len
elements long, dropping excess elements.Shortens the vector, keeping the first
len
elements and dropping +the rest.If
-len
is greater than the vector's current length, this has no effect.Examples
+The
+ +drain
method can emulatetruncate
, but causes the excess +elements to be returned instead of dropped.Examples
+Truncating a five element vector to two elements:
+let mut vec = vec![1, 2, 3, 4, 5]; vec.truncate(2); assert_eq!(vec, [1, 2]);+ +No truncation occurs when
+ +len
is greater than the vector's current +length:+let mut vec = vec![1, 2, 3]; +vec.truncate(8); +assert_eq!(vec, [1, 2, 3]);+ +Truncating when
+ +len == 0
is equivalent to calling theclear
+method.+let mut vec = vec![1, 2, 3]; +vec.truncate(0); +assert_eq!(vec, []);
fn as_slice(&self) -> &[T]
1.7.0Extracts a slice containing the entire vector.
Equivalent to
+ +&s[..]
.Examples
++use std::io::{self, Write}; +let buffer = vec![1, 2, 3, 5, 8]; +io::sink().write(buffer.as_slice()).unwrap();
fn as_mut_slice(&mut self) -> &mut [T]
1.7.0Extracts a mutable slice of the entire vector.
Equivalent to
+ +&mut s[..]
.Examples
++use std::io::{self, Read}; +let mut buffer = vec![0; 3]; +io::repeat(0b101).read_exact(buffer.as_mut_slice()).unwrap();
unsafe fn set_len(&mut self, len: usize)
1.0.0Sets the length of a vector.
@@ -172,11 +222,38 @@ effect. modifying its buffers, so it is up to the caller to ensure that the vector is actually the specified size. -Examples
+Examples
-let mut v = vec![1, 2, 3, 4]; +use std::ptr; + +let mut vec = vec!['r', 'u', 's', 't']; + unsafe { - v.set_len(1); + ptr::drop_in_place(&mut vec[3]); + vec.set_len(3); +} +assert_eq!(vec, ['r', 'u', 's']);+ +In this example, there is a memory leak since the memory locations +owned by the inner vectors were not freed prior to the
+ +set_len
call:+let mut vec = vec![vec![1, 0, 0], + vec![0, 1, 0], + vec![0, 0, 1]]; +unsafe { + vec.set_len(0); +}+ +In this example, the vector gets expanded from zero to four items +without any memory allocations occurring, resulting in vector +values of unallocated memory:
+ ++let mut vec: Vec<char> = Vec::new(); + +unsafe { + vec.set_len(4); }
fn swap_remove(&mut self, index: usize) -> T
1.0.0Removes an element from anywhere in the vector and return it, replacing @@ -187,7 +264,7 @@ it with the last element.
Panics
Panics if
-index
is out of bounds.Examples
+Examples
let mut v = vec!["foo", "bar", "baz", "qux"]; @@ -203,7 +280,7 @@ elements after it to the right.Panics
Panics if
-index
is greater than the vector's length.Examples
+Examples
let mut vec = vec![1, 2, 3]; vec.insert(1, 4); @@ -217,7 +294,7 @@ shifting all elements after it to the left.Panics
Panics if
-index
is out of bounds.Examples
+Examples
let mut v = vec![1, 2, 3]; assert_eq!(v.remove(1), 2); @@ -229,7 +306,7 @@ shifting all elements after it to the left. This method operates in place and preserves the order of the retained elements. -Examples
+Examples
let mut vec = vec![1, 2, 3, 4]; vec.retain(|&x| x%2 == 0); @@ -240,7 +317,7 @@ elements.Panics
Panics if the number of elements in the vector overflows a
-usize
.Examples
+Examples
let mut vec = vec![1, 2]; vec.push(3); @@ -249,7 +326,7 @@ elements.Removes the last element from a vector and returns it, or
-None
if it is empty.Examples
+Examples
let mut vec = vec![1, 2, 3]; assert_eq!(vec.pop(), Some(3)); @@ -260,7 +337,7 @@ is empty.Panics
Panics if the number of elements in the vector overflows a
-usize
.Examples
+Examples
let mut vec = vec![1, 2, 3]; let mut vec2 = vec![4, 5, 6]; @@ -281,7 +358,7 @@ if theDrain
value is leaked.Panics if the starting point is greater than the end point or if the end point is greater than the length of the vector.
-Examples
+Examples
let mut v = vec![1, 2, 3]; let u: Vec<_> = v.drain(1..).collect(); @@ -294,7 +371,7 @@ the end point is greater than the length of the vector.
fn clear(&mut self)
1.0.0Clears the vector, removing all values.
-Examples
+Examples
let mut v = vec![1, 2, 3]; @@ -304,14 +381,14 @@ the end point is greater than the length of the vector.
fn len(&self) -> usize
1.0.0Returns the number of elements in the vector.
-Examples
+Examples
let a = vec![1, 2, 3]; assert_eq!(a.len(), 3);
fn is_empty(&self) -> bool
1.0.0Returns
-true
if the vector contains no elements.Examples
+Examples
let mut v = Vec::new(); assert!(v.is_empty()); @@ -329,7 +406,7 @@ and the returnedSelf
contains elements[at, len)
.Panics
Panics if
-at > len
.Examples
+Examples
let mut vec = vec![1,2,3]; let vec2 = vec.split_off(1); @@ -342,7 +419,7 @@ and the returnedSelf
contains elements[at, len)
. difference, with each additional slot filled withvalue
. Ifnew_len
is less thanlen()
, theVec
is simply truncated. -Examples
+Examples
let mut vec = vec!["hello"]; vec.resize(3, "world"); @@ -362,7 +439,7 @@ specialized to work with slices instead. If and when Rust gets specialization this function will likely be deprecated (but still available). -Examples
+Examples
let mut vec = vec![1]; vec.extend_from_slice(&[2, 3, 4]); @@ -372,7 +449,7 @@ available).If the vector is sorted, this removes all duplicates.
-Examples
+Examples
let mut vec = vec![1, 2, 2, 3, 2]; diff --git a/iron/headers/struct.Referer.html b/iron/headers/struct.Referer.html index 453f6ff2..b2ceef46 100644 --- a/iron/headers/struct.Referer.html +++ b/iron/headers/struct.Referer.html @@ -304,6 +304,28 @@ lie on a+char
boundary. s.insert(2, 'o'); assert_eq!("foo", s);+
fn insert_str(&mut self, idx: usize, string: &str)
Unstable (insert_str
): recent addition
+Inserts a string slice into this
+ +String
at a byte position.This is an
+ +O(n)
operation as it requires copying every element in the +buffer.Panics
+Panics if
+ +idx
is larger than theString
's length, or if it does not +lie on achar
boundary.Examples
+Basic usage:
+ ++#![feature(insert_str)] + +let mut s = String::from("bar"); + +s.insert_str(0, "foo"); + +assert_eq!("foobar", s);
unsafe fn as_mut_vec(&mut self) -> &mut Vec<u8>
1.0.0Returns a mutable reference to the contents of this
@@ -313,7 +335,7 @@ to it are valid UTF-8. If this constraint is violated, it may cause memory unsafety issues with future users of theString
.String
, as the rest of the standard library assumes thatString
s are valid UTF-8. -Examples
+Examples
Basic usage:
@@ -329,7 +351,7 @@ the standard library assumes thatString
s are valid UTF-8.
fn len(&self) -> usize
1.0.0Returns the length of this
-String
, in bytes.Examples
+Examples
Basic usage:
@@ -341,7 +363,7 @@ the standard library assumes thatString
s are valid UTF-8.Returns
-false
otherwise.Examples
+Examples
Basic usage:
@@ -356,7 +378,7 @@ the standard library assumes thatString
s are valid UTF-8.While this means the
-String
will have a length of zero, it does not touch its capacity.Examples
+Examples
Basic usage:
@@ -374,11 +396,11 @@ and yields the removed chars.Note: The element range is removed even if the iterator is not consumed until the end.
-Panics
+Panics
Panics if the starting point or end point do not lie on a
-char
boundary, or if they're out of bounds.Examples
+Examples
Basic usage:
@@ -398,7 +420,7 @@ boundary, or if they're out of bounds.This will drop any excess capacity.
-Examples
+Examples
Basic usage:
diff --git a/iron/headers/struct.Server.html b/iron/headers/struct.Server.html index 2080df00..8fcac694 100644 --- a/iron/headers/struct.Server.html +++ b/iron/headers/struct.Server.html @@ -299,6 +299,28 @@ lie on a+char
boundary. s.insert(2, 'o'); assert_eq!("foo", s);+
fn insert_str(&mut self, idx: usize, string: &str)
Unstable (insert_str
): recent addition
+Inserts a string slice into this
+ +String
at a byte position.This is an
+ +O(n)
operation as it requires copying every element in the +buffer.Panics
+Panics if
+ +idx
is larger than theString
's length, or if it does not +lie on achar
boundary.Examples
+Basic usage:
+ ++#![feature(insert_str)] + +let mut s = String::from("bar"); + +s.insert_str(0, "foo"); + +assert_eq!("foobar", s);
unsafe fn as_mut_vec(&mut self) -> &mut Vec<u8>
1.0.0Returns a mutable reference to the contents of this
@@ -308,7 +330,7 @@ to it are valid UTF-8. If this constraint is violated, it may cause memory unsafety issues with future users of theString
.String
, as the rest of the standard library assumes thatString
s are valid UTF-8. -Examples
+Examples
Basic usage:
@@ -324,7 +346,7 @@ the standard library assumes thatString
s are valid UTF-8.
fn len(&self) -> usize
1.0.0Returns the length of this
-String
, in bytes.Examples
+Examples
Basic usage:
@@ -336,7 +358,7 @@ the standard library assumes thatString
s are valid UTF-8.Returns
-false
otherwise.Examples
+Examples
Basic usage:
@@ -351,7 +373,7 @@ the standard library assumes thatString
s are valid UTF-8.While this means the
-String
will have a length of zero, it does not touch its capacity.Examples
+Examples
Basic usage:
@@ -369,11 +391,11 @@ and yields the removed chars.Note: The element range is removed even if the iterator is not consumed until the end.
-Panics
+Panics
Panics if the starting point or end point do not lie on a
-char
boundary, or if they're out of bounds.Examples
+Examples
Basic usage:
@@ -393,7 +415,7 @@ boundary, or if they're out of bounds.This will drop any excess capacity.
-Examples
+Examples
Basic usage:
diff --git a/iron/headers/struct.SetCookie.html b/iron/headers/struct.SetCookie.html index fdcccb9b..b667f66d 100644 --- a/iron/headers/struct.SetCookie.html +++ b/iron/headers/struct.SetCookie.html @@ -182,25 +182,75 @@ may still inform the vector that there is space for a few more elements.Note that this will drop any excess capacity. Calling this and converting back to a vector with
+ +into_vec()
is equivalent to callingshrink_to_fit()
.Examples
++let v = vec![1, 2, 3]; + +let slice = v.into_boxed_slice();+ +Any excess capacity is removed:
+ ++let mut vec = Vec::with_capacity(10); +vec.extend([1, 2, 3].iter().cloned()); + +assert_eq!(vec.capacity(), 10); +let slice = vec.into_boxed_slice(); +assert_eq!(slice.into_vec().capacity(), 3);-
fn truncate(&mut self, len: usize)
1.0.0Shorten a vector to be
+len
elements long, dropping excess elements.Shortens the vector, keeping the first
len
elements and dropping +the rest.If
-len
is greater than the vector's current length, this has no effect.Examples
+The
+ +drain
method can emulatetruncate
, but causes the excess +elements to be returned instead of dropped.Examples
+Truncating a five element vector to two elements:
+let mut vec = vec![1, 2, 3, 4, 5]; vec.truncate(2); assert_eq!(vec, [1, 2]);+ +No truncation occurs when
+ +len
is greater than the vector's current +length:+let mut vec = vec![1, 2, 3]; +vec.truncate(8); +assert_eq!(vec, [1, 2, 3]);+ +Truncating when
+ +len == 0
is equivalent to calling theclear
+method.+let mut vec = vec![1, 2, 3]; +vec.truncate(0); +assert_eq!(vec, []);
fn as_slice(&self) -> &[T]
1.7.0Extracts a slice containing the entire vector.
Equivalent to
+ +&s[..]
.Examples
++use std::io::{self, Write}; +let buffer = vec![1, 2, 3, 5, 8]; +io::sink().write(buffer.as_slice()).unwrap();
fn as_mut_slice(&mut self) -> &mut [T]
1.7.0Extracts a mutable slice of the entire vector.
Equivalent to
+ +&mut s[..]
.Examples
++use std::io::{self, Read}; +let mut buffer = vec![0; 3]; +io::repeat(0b101).read_exact(buffer.as_mut_slice()).unwrap();
unsafe fn set_len(&mut self, len: usize)
1.0.0Sets the length of a vector.
@@ -208,11 +258,38 @@ effect. modifying its buffers, so it is up to the caller to ensure that the vector is actually the specified size. -Examples
+Examples
-let mut v = vec![1, 2, 3, 4]; +use std::ptr; + +let mut vec = vec!['r', 'u', 's', 't']; + unsafe { - v.set_len(1); + ptr::drop_in_place(&mut vec[3]); + vec.set_len(3); +} +assert_eq!(vec, ['r', 'u', 's']);+ +In this example, there is a memory leak since the memory locations +owned by the inner vectors were not freed prior to the
+ +set_len
call:+let mut vec = vec![vec![1, 0, 0], + vec![0, 1, 0], + vec![0, 0, 1]]; +unsafe { + vec.set_len(0); +}+ +In this example, the vector gets expanded from zero to four items +without any memory allocations occurring, resulting in vector +values of unallocated memory:
+ ++let mut vec: Vec<char> = Vec::new(); + +unsafe { + vec.set_len(4); }
fn swap_remove(&mut self, index: usize) -> T
1.0.0Removes an element from anywhere in the vector and return it, replacing @@ -223,7 +300,7 @@ it with the last element.
Panics
Panics if
-index
is out of bounds.Examples
+Examples
let mut v = vec!["foo", "bar", "baz", "qux"]; @@ -239,7 +316,7 @@ elements after it to the right.Panics
Panics if
-index
is greater than the vector's length.Examples
+Examples
let mut vec = vec![1, 2, 3]; vec.insert(1, 4); @@ -253,7 +330,7 @@ shifting all elements after it to the left.Panics
Panics if
-index
is out of bounds.Examples
+Examples
let mut v = vec![1, 2, 3]; assert_eq!(v.remove(1), 2); @@ -265,7 +342,7 @@ shifting all elements after it to the left. This method operates in place and preserves the order of the retained elements. -Examples
+Examples
let mut vec = vec![1, 2, 3, 4]; vec.retain(|&x| x%2 == 0); @@ -276,7 +353,7 @@ elements.Panics
Panics if the number of elements in the vector overflows a
-usize
.Examples
+Examples
let mut vec = vec![1, 2]; vec.push(3); @@ -285,7 +362,7 @@ elements.Removes the last element from a vector and returns it, or
-None
if it is empty.Examples
+Examples
let mut vec = vec![1, 2, 3]; assert_eq!(vec.pop(), Some(3)); @@ -296,7 +373,7 @@ is empty.Panics
Panics if the number of elements in the vector overflows a
-usize
.Examples
+Examples
let mut vec = vec![1, 2, 3]; let mut vec2 = vec![4, 5, 6]; @@ -317,7 +394,7 @@ if theDrain
value is leaked.Panics if the starting point is greater than the end point or if the end point is greater than the length of the vector.
-Examples
+Examples
let mut v = vec![1, 2, 3]; let u: Vec<_> = v.drain(1..).collect(); @@ -330,7 +407,7 @@ the end point is greater than the length of the vector.
fn clear(&mut self)
1.0.0Clears the vector, removing all values.
-Examples
+Examples
let mut v = vec![1, 2, 3]; @@ -340,14 +417,14 @@ the end point is greater than the length of the vector.
fn len(&self) -> usize
1.0.0Returns the number of elements in the vector.
-Examples
+Examples
let a = vec![1, 2, 3]; assert_eq!(a.len(), 3);
fn is_empty(&self) -> bool
1.0.0Returns
-true
if the vector contains no elements.Examples
+Examples
let mut v = Vec::new(); assert!(v.is_empty()); @@ -365,7 +442,7 @@ and the returnedSelf
contains elements[at, len)
.Panics
Panics if
-at > len
.Examples
+Examples
let mut vec = vec![1,2,3]; let vec2 = vec.split_off(1); @@ -378,7 +455,7 @@ and the returnedSelf
contains elements[at, len)
. difference, with each additional slot filled withvalue
. Ifnew_len
is less thanlen()
, theVec
is simply truncated. -Examples
+Examples
let mut vec = vec!["hello"]; vec.resize(3, "world"); @@ -398,7 +475,7 @@ specialized to work with slices instead. If and when Rust gets specialization this function will likely be deprecated (but still available). -Examples
+Examples
let mut vec = vec![1]; vec.extend_from_slice(&[2, 3, 4]); @@ -408,7 +485,7 @@ available).If the vector is sorted, this removes all duplicates.
-Examples
+Examples
let mut vec = vec![1, 2, 2, 3, 2]; diff --git a/iron/headers/struct.TransferEncoding.html b/iron/headers/struct.TransferEncoding.html index b1cb9225..8c9f28a0 100644 --- a/iron/headers/struct.TransferEncoding.html +++ b/iron/headers/struct.TransferEncoding.html @@ -133,25 +133,75 @@ may still inform the vector that there is space for a few more elements.Note that this will drop any excess capacity. Calling this and converting back to a vector with
+ +into_vec()
is equivalent to callingshrink_to_fit()
.Examples
++let v = vec![1, 2, 3]; + +let slice = v.into_boxed_slice();+ +Any excess capacity is removed:
+ ++let mut vec = Vec::with_capacity(10); +vec.extend([1, 2, 3].iter().cloned()); + +assert_eq!(vec.capacity(), 10); +let slice = vec.into_boxed_slice(); +assert_eq!(slice.into_vec().capacity(), 3);-
fn truncate(&mut self, len: usize)
1.0.0Shorten a vector to be
+len
elements long, dropping excess elements.Shortens the vector, keeping the first
len
elements and dropping +the rest.If
-len
is greater than the vector's current length, this has no effect.Examples
+The
+ +drain
method can emulatetruncate
, but causes the excess +elements to be returned instead of dropped.Examples
+Truncating a five element vector to two elements:
+let mut vec = vec![1, 2, 3, 4, 5]; vec.truncate(2); assert_eq!(vec, [1, 2]);+ +No truncation occurs when
+ +len
is greater than the vector's current +length:+let mut vec = vec![1, 2, 3]; +vec.truncate(8); +assert_eq!(vec, [1, 2, 3]);+ +Truncating when
+ +len == 0
is equivalent to calling theclear
+method.+let mut vec = vec![1, 2, 3]; +vec.truncate(0); +assert_eq!(vec, []);
fn as_slice(&self) -> &[T]
1.7.0Extracts a slice containing the entire vector.
Equivalent to
+ +&s[..]
.Examples
++use std::io::{self, Write}; +let buffer = vec![1, 2, 3, 5, 8]; +io::sink().write(buffer.as_slice()).unwrap();
fn as_mut_slice(&mut self) -> &mut [T]
1.7.0Extracts a mutable slice of the entire vector.
Equivalent to
+ +&mut s[..]
.Examples
++use std::io::{self, Read}; +let mut buffer = vec![0; 3]; +io::repeat(0b101).read_exact(buffer.as_mut_slice()).unwrap();
unsafe fn set_len(&mut self, len: usize)
1.0.0Sets the length of a vector.
@@ -159,11 +209,38 @@ effect. modifying its buffers, so it is up to the caller to ensure that the vector is actually the specified size. -Examples
+Examples
-let mut v = vec![1, 2, 3, 4]; +use std::ptr; + +let mut vec = vec!['r', 'u', 's', 't']; + unsafe { - v.set_len(1); + ptr::drop_in_place(&mut vec[3]); + vec.set_len(3); +} +assert_eq!(vec, ['r', 'u', 's']);+ +In this example, there is a memory leak since the memory locations +owned by the inner vectors were not freed prior to the
+ +set_len
call:+let mut vec = vec![vec![1, 0, 0], + vec![0, 1, 0], + vec![0, 0, 1]]; +unsafe { + vec.set_len(0); +}+ +In this example, the vector gets expanded from zero to four items +without any memory allocations occurring, resulting in vector +values of unallocated memory:
+ ++let mut vec: Vec<char> = Vec::new(); + +unsafe { + vec.set_len(4); }
fn swap_remove(&mut self, index: usize) -> T
1.0.0Removes an element from anywhere in the vector and return it, replacing @@ -174,7 +251,7 @@ it with the last element.
Panics
Panics if
-index
is out of bounds.Examples
+Examples
let mut v = vec!["foo", "bar", "baz", "qux"]; @@ -190,7 +267,7 @@ elements after it to the right.Panics
Panics if
-index
is greater than the vector's length.Examples
+Examples
let mut vec = vec![1, 2, 3]; vec.insert(1, 4); @@ -204,7 +281,7 @@ shifting all elements after it to the left.Panics
Panics if
-index
is out of bounds.Examples
+Examples
let mut v = vec![1, 2, 3]; assert_eq!(v.remove(1), 2); @@ -216,7 +293,7 @@ shifting all elements after it to the left. This method operates in place and preserves the order of the retained elements. -Examples
+Examples
let mut vec = vec![1, 2, 3, 4]; vec.retain(|&x| x%2 == 0); @@ -227,7 +304,7 @@ elements.Panics
Panics if the number of elements in the vector overflows a
-usize
.Examples
+Examples
let mut vec = vec![1, 2]; vec.push(3); @@ -236,7 +313,7 @@ elements.Removes the last element from a vector and returns it, or
-None
if it is empty.Examples
+Examples
let mut vec = vec![1, 2, 3]; assert_eq!(vec.pop(), Some(3)); @@ -247,7 +324,7 @@ is empty.Panics
Panics if the number of elements in the vector overflows a
-usize
.Examples
+Examples
let mut vec = vec![1, 2, 3]; let mut vec2 = vec![4, 5, 6]; @@ -268,7 +345,7 @@ if theDrain
value is leaked.Panics if the starting point is greater than the end point or if the end point is greater than the length of the vector.
-Examples
+Examples
let mut v = vec![1, 2, 3]; let u: Vec<_> = v.drain(1..).collect(); @@ -281,7 +358,7 @@ the end point is greater than the length of the vector.
fn clear(&mut self)
1.0.0Clears the vector, removing all values.
-Examples
+Examples
let mut v = vec![1, 2, 3]; @@ -291,14 +368,14 @@ the end point is greater than the length of the vector.
fn len(&self) -> usize
1.0.0Returns the number of elements in the vector.
-Examples
+Examples
let a = vec![1, 2, 3]; assert_eq!(a.len(), 3);
fn is_empty(&self) -> bool
1.0.0Returns
-true
if the vector contains no elements.Examples
+Examples
let mut v = Vec::new(); assert!(v.is_empty()); @@ -316,7 +393,7 @@ and the returnedSelf
contains elements[at, len)
.Panics
Panics if
-at > len
.Examples
+Examples
let mut vec = vec![1,2,3]; let vec2 = vec.split_off(1); @@ -329,7 +406,7 @@ and the returnedSelf
contains elements[at, len)
. difference, with each additional slot filled withvalue
. Ifnew_len
is less thanlen()
, theVec
is simply truncated. -Examples
+Examples
let mut vec = vec!["hello"]; vec.resize(3, "world"); @@ -349,7 +426,7 @@ specialized to work with slices instead. If and when Rust gets specialization this function will likely be deprecated (but still available). -Examples
+Examples
let mut vec = vec![1]; vec.extend_from_slice(&[2, 3, 4]); @@ -359,7 +436,7 @@ available).If the vector is sorted, this removes all duplicates.
-Examples
+Examples
let mut vec = vec![1, 2, 2, 3, 2]; diff --git a/iron/headers/struct.Upgrade.html b/iron/headers/struct.Upgrade.html index 0071ea6e..33707766 100644 --- a/iron/headers/struct.Upgrade.html +++ b/iron/headers/struct.Upgrade.html @@ -150,25 +150,75 @@ may still inform the vector that there is space for a few more elements.Note that this will drop any excess capacity. Calling this and converting back to a vector with
+ +into_vec()
is equivalent to callingshrink_to_fit()
.Examples
++let v = vec![1, 2, 3]; + +let slice = v.into_boxed_slice();+ +Any excess capacity is removed:
+ ++let mut vec = Vec::with_capacity(10); +vec.extend([1, 2, 3].iter().cloned()); + +assert_eq!(vec.capacity(), 10); +let slice = vec.into_boxed_slice(); +assert_eq!(slice.into_vec().capacity(), 3);-
fn truncate(&mut self, len: usize)
1.0.0Shorten a vector to be
+len
elements long, dropping excess elements.Shortens the vector, keeping the first
len
elements and dropping +the rest.If
-len
is greater than the vector's current length, this has no effect.Examples
+The
+ +drain
method can emulatetruncate
, but causes the excess +elements to be returned instead of dropped.Examples
+Truncating a five element vector to two elements:
+let mut vec = vec![1, 2, 3, 4, 5]; vec.truncate(2); assert_eq!(vec, [1, 2]);+ +No truncation occurs when
+ +len
is greater than the vector's current +length:+let mut vec = vec![1, 2, 3]; +vec.truncate(8); +assert_eq!(vec, [1, 2, 3]);+ +Truncating when
+ +len == 0
is equivalent to calling theclear
+method.+let mut vec = vec![1, 2, 3]; +vec.truncate(0); +assert_eq!(vec, []);
fn as_slice(&self) -> &[T]
1.7.0Extracts a slice containing the entire vector.
Equivalent to
+ +&s[..]
.Examples
++use std::io::{self, Write}; +let buffer = vec![1, 2, 3, 5, 8]; +io::sink().write(buffer.as_slice()).unwrap();
fn as_mut_slice(&mut self) -> &mut [T]
1.7.0Extracts a mutable slice of the entire vector.
Equivalent to
+ +&mut s[..]
.Examples
++use std::io::{self, Read}; +let mut buffer = vec![0; 3]; +io::repeat(0b101).read_exact(buffer.as_mut_slice()).unwrap();
unsafe fn set_len(&mut self, len: usize)
1.0.0Sets the length of a vector.
@@ -176,11 +226,38 @@ effect. modifying its buffers, so it is up to the caller to ensure that the vector is actually the specified size. -Examples
+Examples
-let mut v = vec![1, 2, 3, 4]; +use std::ptr; + +let mut vec = vec!['r', 'u', 's', 't']; + unsafe { - v.set_len(1); + ptr::drop_in_place(&mut vec[3]); + vec.set_len(3); +} +assert_eq!(vec, ['r', 'u', 's']);+ +In this example, there is a memory leak since the memory locations +owned by the inner vectors were not freed prior to the
+ +set_len
call:+let mut vec = vec![vec![1, 0, 0], + vec![0, 1, 0], + vec![0, 0, 1]]; +unsafe { + vec.set_len(0); +}+ +In this example, the vector gets expanded from zero to four items +without any memory allocations occurring, resulting in vector +values of unallocated memory:
+ ++let mut vec: Vec<char> = Vec::new(); + +unsafe { + vec.set_len(4); }
fn swap_remove(&mut self, index: usize) -> T
1.0.0Removes an element from anywhere in the vector and return it, replacing @@ -191,7 +268,7 @@ it with the last element.
Panics
Panics if
-index
is out of bounds.Examples
+Examples
let mut v = vec!["foo", "bar", "baz", "qux"]; @@ -207,7 +284,7 @@ elements after it to the right.Panics
Panics if
-index
is greater than the vector's length.Examples
+Examples
let mut vec = vec![1, 2, 3]; vec.insert(1, 4); @@ -221,7 +298,7 @@ shifting all elements after it to the left.Panics
Panics if
-index
is out of bounds.Examples
+Examples
let mut v = vec![1, 2, 3]; assert_eq!(v.remove(1), 2); @@ -233,7 +310,7 @@ shifting all elements after it to the left. This method operates in place and preserves the order of the retained elements. -Examples
+Examples
let mut vec = vec![1, 2, 3, 4]; vec.retain(|&x| x%2 == 0); @@ -244,7 +321,7 @@ elements.Panics
Panics if the number of elements in the vector overflows a
-usize
.Examples
+Examples
let mut vec = vec![1, 2]; vec.push(3); @@ -253,7 +330,7 @@ elements.Removes the last element from a vector and returns it, or
-None
if it is empty.Examples
+Examples
let mut vec = vec![1, 2, 3]; assert_eq!(vec.pop(), Some(3)); @@ -264,7 +341,7 @@ is empty.Panics
Panics if the number of elements in the vector overflows a
-usize
.Examples
+Examples
let mut vec = vec![1, 2, 3]; let mut vec2 = vec![4, 5, 6]; @@ -285,7 +362,7 @@ if theDrain
value is leaked.Panics if the starting point is greater than the end point or if the end point is greater than the length of the vector.
-Examples
+Examples
let mut v = vec![1, 2, 3]; let u: Vec<_> = v.drain(1..).collect(); @@ -298,7 +375,7 @@ the end point is greater than the length of the vector.
fn clear(&mut self)
1.0.0Clears the vector, removing all values.
-Examples
+Examples
let mut v = vec![1, 2, 3]; @@ -308,14 +385,14 @@ the end point is greater than the length of the vector.
fn len(&self) -> usize
1.0.0Returns the number of elements in the vector.
-Examples
+Examples
let a = vec![1, 2, 3]; assert_eq!(a.len(), 3);
fn is_empty(&self) -> bool
1.0.0Returns
-true
if the vector contains no elements.Examples
+Examples
let mut v = Vec::new(); assert!(v.is_empty()); @@ -333,7 +410,7 @@ and the returnedSelf
contains elements[at, len)
.Panics
Panics if
-at > len
.Examples
+Examples
let mut vec = vec![1,2,3]; let vec2 = vec.split_off(1); @@ -346,7 +423,7 @@ and the returnedSelf
contains elements[at, len)
. difference, with each additional slot filled withvalue
. Ifnew_len
is less thanlen()
, theVec
is simply truncated. -Examples
+Examples
let mut vec = vec!["hello"]; vec.resize(3, "world"); @@ -366,7 +443,7 @@ specialized to work with slices instead. If and when Rust gets specialization this function will likely be deprecated (but still available). -Examples
+Examples
let mut vec = vec![1]; vec.extend_from_slice(&[2, 3, 4]); @@ -376,7 +453,7 @@ available).If the vector is sorted, this removes all duplicates.
-Examples
+Examples
let mut vec = vec![1, 2, 2, 3, 2]; diff --git a/iron/headers/struct.UserAgent.html b/iron/headers/struct.UserAgent.html index 3f13c3bf..68f7584c 100644 --- a/iron/headers/struct.UserAgent.html +++ b/iron/headers/struct.UserAgent.html @@ -308,6 +308,28 @@ lie on a+char
boundary. s.insert(2, 'o'); assert_eq!("foo", s);+
fn insert_str(&mut self, idx: usize, string: &str)
Unstable (insert_str
): recent addition
+Inserts a string slice into this
+ +String
at a byte position.This is an
+ +O(n)
operation as it requires copying every element in the +buffer.Panics
+Panics if
+ +idx
is larger than theString
's length, or if it does not +lie on achar
boundary.Examples
+Basic usage:
+ ++#![feature(insert_str)] + +let mut s = String::from("bar"); + +s.insert_str(0, "foo"); + +assert_eq!("foobar", s);
unsafe fn as_mut_vec(&mut self) -> &mut Vec<u8>
1.0.0Returns a mutable reference to the contents of this
@@ -317,7 +339,7 @@ to it are valid UTF-8. If this constraint is violated, it may cause memory unsafety issues with future users of theString
.String
, as the rest of the standard library assumes thatString
s are valid UTF-8. -Examples
+Examples
Basic usage:
@@ -333,7 +355,7 @@ the standard library assumes thatString
s are valid UTF-8.
fn len(&self) -> usize
1.0.0Returns the length of this
-String
, in bytes.Examples
+Examples
Basic usage:
@@ -345,7 +367,7 @@ the standard library assumes thatString
s are valid UTF-8.Returns
-false
otherwise.Examples
+Examples
Basic usage:
@@ -360,7 +382,7 @@ the standard library assumes thatString
s are valid UTF-8.While this means the
-String
will have a length of zero, it does not touch its capacity.Examples
+Examples
Basic usage:
@@ -378,11 +400,11 @@ and yields the removed chars.Note: The element range is removed even if the iterator is not consumed until the end.
-Panics
+Panics
Panics if the starting point or end point do not lie on a
-char
boundary, or if they're out of bounds.Examples
+Examples
Basic usage:
@@ -402,7 +424,7 @@ boundary, or if they're out of bounds.This will drop any excess capacity.
-Examples
+Examples
Basic usage:
diff --git a/iron/mime/enum.Attr.html b/iron/mime/enum.Attr.html index c6cf83ea..df7287ef 100644 --- a/iron/mime/enum.Attr.html +++ b/iron/mime/enum.Attr.html @@ -1127,6 +1127,9 @@ replaces them with the replacement string slice. let new_year = "农历新年"; assert_eq!(new_year, new_year.to_uppercase());++
fn escape_debug(&self) -> String
Unstable (str_escape
): return type may change to be an iterator
+Escapes each char in
s
withchar::escape_debug
.
fn escape_default(&self) -> String
Unstable (str_escape
): return type may change to be an iterator
Escapes each char in
diff --git a/iron/mime/enum.SubLevel.html b/iron/mime/enum.SubLevel.html index 78961d51..3ec1e122 100644 --- a/iron/mime/enum.SubLevel.html +++ b/iron/mime/enum.SubLevel.html @@ -1140,6 +1140,9 @@ replaces them with the replacement string slice. let new_year = "农历新年"; assert_eq!(new_year, new_year.to_uppercase()); +s
withchar::escape_default
.+
fn escape_debug(&self) -> String
Unstable (str_escape
): return type may change to be an iterator
+Escapes each char in
s
withchar::escape_debug
.
fn escape_default(&self) -> String
Unstable (str_escape
): return type may change to be an iterator
Escapes each char in
diff --git a/iron/mime/enum.TopLevel.html b/iron/mime/enum.TopLevel.html index c6b5a46f..3248f31a 100644 --- a/iron/mime/enum.TopLevel.html +++ b/iron/mime/enum.TopLevel.html @@ -1133,6 +1133,9 @@ replaces them with the replacement string slice. let new_year = "农历新年"; assert_eq!(new_year, new_year.to_uppercase()); +s
withchar::escape_default
.+
fn escape_debug(&self) -> String
Unstable (str_escape
): return type may change to be an iterator
+Escapes each char in
s
withchar::escape_debug
.
fn escape_default(&self) -> String
Unstable (str_escape
): return type may change to be an iterator
Escapes each char in
diff --git a/iron/mime/enum.Value.html b/iron/mime/enum.Value.html index efa53880..7f02f541 100644 --- a/iron/mime/enum.Value.html +++ b/iron/mime/enum.Value.html @@ -1125,6 +1125,9 @@ replaces them with the replacement string slice. let new_year = "农历新年"; assert_eq!(new_year, new_year.to_uppercase()); +s
withchar::escape_default
.+
fn escape_debug(&self) -> String
Unstable (str_escape
): return type may change to be an iterator
+Escapes each char in
s
withchar::escape_debug
.
fn escape_default(&self) -> String
Unstable (str_escape
): return type may change to be an iterator
Escapes each char in
diff --git a/iron/mime/struct.Mime.html b/iron/mime/struct.Mime.html index 9d1aec59..d1b557d7 100644 --- a/iron/mime/struct.Mime.html +++ b/iron/mime/struct.Mime.html @@ -48,7 +48,7 @@ [−] [src] -s
withchar::escape_default
.pub struct Mime<T = Vec<(Attr, Value)>> where T: AsRef<[(Attr, Value)]>(pub TopLevel, pub SubLevel, pub T);Mime, or Media Type. Encapsulates common registers types.
+pub struct Mime<T = Vec<(Attr, Value)>>(pub TopLevel, pub SubLevel, pub T) where T: AsRef<[(Attr, Value)]>;Mime, or Media Type. Encapsulates common registers types.
Consider that a traditional mime type contains a "top level type", a "sub level type", and 0-N "parameters". And they're all strings. diff --git a/juniper/enum.TypeKind.html b/juniper/enum.TypeKind.html index b57e0e99..ecf066f5 100644 --- a/juniper/enum.TypeKind.html +++ b/juniper/enum.TypeKind.html @@ -108,7 +108,7 @@ type, it becomes non-nullable.
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0Performs copy-assignment from
-source
. Read more+
impl<CtxT> GraphQLType<CtxT> for TypeKind
[src]
impl<CtxT> GraphQLType<CtxT> for TypeKind
[src]
fn name() -> Option<&'static str>
The name of the GraphQL type to expose. Read more
@@ -121,10 +121,10 @@ type, it becomes non-nullable.
fn meta(registry: &mut Registry<CtxT>) -> MetaType
Resolve this interface or union into a concrete type Read more
fn concrete_type_name(&self, context: &CtxT) -> String
Return the concrete type name for this instance/union. Read more
-+
impl FromInputValue for TypeKind
[src]
impl FromInputValue for TypeKind
[src]
fn from(v: &InputValue) -> Option<TypeKind>
Performs the conversion.
-+
impl ToInputValue for TypeKind
[src]
impl ToInputValue for TypeKind
[src]diff --git a/juniper/fn.execute_validated_query.html b/juniper/fn.execute_validated_query.html index 4d6b4dde..def085ef 100644 --- a/juniper/fn.execute_validated_query.html +++ b/juniper/fn.execute_validated_query.html @@ -48,7 +48,7 @@ [−] [src] -
fn to(&self) -> InputValue
Performs the conversion.
pub fn execute_validated_query<QueryT, MutationT, CtxT>(document: Document, operation_name: Option<&str>, root_node: &RootNode<CtxT, QueryT, MutationT>, variables: &HashMap<String, InputValue>, context: &CtxT) -> (Value, Vec<ExecutionError>) where QueryT: GraphQLType<CtxT>, MutationT: GraphQLType<CtxT>+pub fn execute_validated_query<QueryT, MutationT, CtxT>(document: Vec<Definition>, operation_name: Option<&str>, root_node: &RootNode<CtxT, QueryT, MutationT>, variables: &HashMap<String, InputValue>, context: &CtxT) -> (Value, Vec<ExecutionError>) where QueryT: GraphQLType<CtxT>, MutationT: GraphQLType<CtxT>diff --git a/juniper/macro.graphql_enum!.html b/juniper/macro.graphql_enum!.html index 2e2bd20a..f9dd70e5 100644 --- a/juniper/macro.graphql_enum!.html +++ b/juniper/macro.graphql_enum!.html @@ -47,15 +47,57 @@ [−] - [src] + [src]macro_rules! graphql_enum { ( @as_expr, $e:expr) => { ... }; ( @as_pattern, $p:pat) => { ... }; - ( $name:path as $outname:tt { $($eval:path => $ename:tt),* }) => { ... }; - ( $name:path as $outname:tt { $($eval:path => $ename:tt, )* }) => { ... }; - ( $name:path { $($eval:path => $ename:tt),* }) => { ... }; - ( $name:path { $($eval:path => $ename:tt, )* }) => { ... }; + ( @as_path, $p:path) => { ... }; + ( @maybe_apply, None, $func:ident, $val:expr ) => { ... }; + ( @maybe_apply, $arg:tt, $func:ident, $val:expr ) => { ... }; + ( + @generate, + ( $name:path, $outname:tt, $descr:tt ), + [ $( ( $eval:tt, $ename:tt, $edescr:tt, $edepr:tt ) , )* ] + ) => { ... }; + ( @parse, $meta:tt, $acc:tt, ) => { ... }; + ( @parse, $meta:tt, $acc:tt, , $($rest:tt)* ) => { ... }; + ( + @parse, + ( $name:tt, $outname:tt, $_ignore:tt ), + $acc:tt, + description: $descr:tt $($items:tt)* + ) => { ... }; + ( + @parse, + $meta:tt, + [ $($acc:tt ,)* ], + $eval:path => $ename:tt deprecated $depr:tt $($rest:tt)* + ) => { ... }; + ( + @parse, + $meta:tt, + [ $($acc:tt ,)* ], + $eval:path => $ename:tt as $descr:tt deprecated $depr:tt $($rest:tt)* + ) => { ... }; + ( + @parse, + $meta:tt, + [ $($acc:tt ,)* ], + $eval:path => $ename:tt as $descr:tt $($rest:tt)* + ) => { ... }; + ( + @parse, + $meta:tt, + [ $($acc:tt ,)* ], + $eval:path => $ename:tt $($rest:tt)* + ) => { ... }; + ( + $name:path as $outname:tt { $($items:tt)* } + ) => { ... }; + ( + $name:path { $($items:tt)* } + ) => { ... }; }Expose simple enums
diff --git a/language_tags/enum.Error.html b/language_tags/enum.Error.html index b7831c07..9be5cae9 100644 --- a/language_tags/enum.Error.html +++ b/language_tags/enum.Error.html @@ -82,7 +82,7 @@
fn description(&self) -> &str
A short description of the error. Read more
-
fn cause(&self) -> Option<&Error>
1.0.0The lower-level cause of this error, if any.
+The lower-level cause of this error, if any. Read more
impl Display for Error
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter.
diff --git a/lazy_static/index.html b/lazy_static/index.html index 3abc0c61..da1aa0de 100644 --- a/lazy_static/index.html +++ b/lazy_static/index.html @@ -47,7 +47,7 @@ [−] - [src] + [src]A macro for declaring lazily evaluated statics.
Using this macro, it is possible to have
static
s that require code to be @@ -108,37 +108,13 @@ trait.Implementation details
The
-Deref
implementation uses a hidden static variable that is guarded by a atomic check on each access. On stable Rust, the macro may need to allocate each static on the heap.Modules
+Macros
-
- lazy -- - -Macros
--
- __lazy_static_create! -- - -lazy_static! - -Traits
--
diff --git a/lazy_static/macro.lazy_static!.html b/lazy_static/macro.lazy_static!.html index f91ca144..3f6fd838 100644 --- a/lazy_static/macro.lazy_static!.html +++ b/lazy_static/macro.lazy_static!.html @@ -47,14 +47,14 @@ [−] - [src] + [src]- __Deref -- The
Deref
trait is used to specify the functionality of dereferencing -operations, like*v
.macro_rules! lazy_static { ($(#[$attr:meta])* static ref $N:ident : $T:ty = $e:expr; $($t:tt)*) => { ... }; ($(#[$attr:meta])* pub static ref $N:ident : $T:ty = $e:expr; $($t:tt)*) => { ... }; - (@$VIS:ident, $(#[$attr:meta])* static ref $N:ident : $T:ty = $e:expr; $($t:tt)*) => { ... }; - (@MAKE TY, PUB, $(#[$attr:meta])*, $N:ident) => { ... }; - (@MAKE TY, PRIV, $(#[$attr:meta])*, $N:ident) => { ... }; + ($VIS:ident, $(#[$attr:meta])* static ref $N:ident : $T:ty = $e:expr; $($t:tt)*) => { ... }; + (MAKE TY, PUB, $(#[$attr:meta])*, $N:ident) => { ... }; + (MAKE TY, PRIV, $(#[$attr:meta])*, $N:ident) => { ... }; () => { ... }; }diff --git a/lazy_static/sidebar-items.js b/lazy_static/sidebar-items.js index 9a451a21..89e4534f 100644 --- a/lazy_static/sidebar-items.js +++ b/lazy_static/sidebar-items.js @@ -1 +1 @@ -initSidebarItems({"macro":[["__lazy_static_create!",""],["lazy_static!",""]],"mod":[["lazy",""]],"trait":[["__Deref","The `Deref` trait is used to specify the functionality of dereferencing operations, like `*v`."]]}); \ No newline at end of file +initSidebarItems({"macro":[["lazy_static!",""]]}); \ No newline at end of file diff --git a/lazy_static/trait.__Deref.html b/lazy_static/trait.__Deref.html index c85f9ff6..c3b4aa40 100644 --- a/lazy_static/trait.__Deref.html +++ b/lazy_static/trait.__Deref.html @@ -47,7 +47,7 @@ [−] - [src] + [src]pub trait __Deref { type Target: ?Sized; fn deref(&self) -> &Self::Target; diff --git a/libc/dox/enum.Option.html b/libc/dox/enum.Option.html deleted file mode 100644 index e62d7cc7..00000000 --- a/libc/dox/enum.Option.html +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - -Redirecting to ../../core/option/enum.Option.html...
- - - \ No newline at end of file diff --git a/libc/dox/imp/enum.Option.html b/libc/dox/imp/enum.Option.html deleted file mode 100644 index 749350f5..00000000 --- a/libc/dox/imp/enum.Option.html +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - -Redirecting to ../../../core/option/enum.Option.html...
- - - \ No newline at end of file diff --git a/libc/dox/imp/mem/constant.POST_DROP_U16.html b/libc/dox/imp/mem/constant.POST_DROP_U16.html deleted file mode 100644 index 7d94490d..00000000 --- a/libc/dox/imp/mem/constant.POST_DROP_U16.html +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - -Redirecting to ../../../../core/mem/constant.POST_DROP_U16.html...
- - - \ No newline at end of file diff --git a/libc/dox/imp/mem/constant.POST_DROP_U32.html b/libc/dox/imp/mem/constant.POST_DROP_U32.html deleted file mode 100644 index 987b2e14..00000000 --- a/libc/dox/imp/mem/constant.POST_DROP_U32.html +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - -Redirecting to ../../../../core/mem/constant.POST_DROP_U32.html...
- - - \ No newline at end of file diff --git a/libc/dox/imp/mem/constant.POST_DROP_U64.html b/libc/dox/imp/mem/constant.POST_DROP_U64.html deleted file mode 100644 index 6834f44a..00000000 --- a/libc/dox/imp/mem/constant.POST_DROP_U64.html +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - -Redirecting to ../../../../core/mem/constant.POST_DROP_U64.html...
- - - \ No newline at end of file diff --git a/libc/dox/imp/mem/constant.POST_DROP_U8.html b/libc/dox/imp/mem/constant.POST_DROP_U8.html deleted file mode 100644 index a3dabf15..00000000 --- a/libc/dox/imp/mem/constant.POST_DROP_U8.html +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - -Redirecting to ../../../../core/mem/constant.POST_DROP_U8.html...
- - - \ No newline at end of file diff --git a/libc/dox/imp/mem/constant.POST_DROP_USIZE.html b/libc/dox/imp/mem/constant.POST_DROP_USIZE.html deleted file mode 100644 index 28a2b540..00000000 --- a/libc/dox/imp/mem/constant.POST_DROP_USIZE.html +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - -Redirecting to ../../../../core/mem/constant.POST_DROP_USIZE.html...
- - - \ No newline at end of file diff --git a/libc/dox/imp/mem/fn.align_of.html b/libc/dox/imp/mem/fn.align_of.html deleted file mode 100644 index ba12cd3d..00000000 --- a/libc/dox/imp/mem/fn.align_of.html +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - -Redirecting to ../../../../core/mem/fn.align_of.html...
- - - \ No newline at end of file diff --git a/libc/dox/imp/mem/fn.align_of_val.html b/libc/dox/imp/mem/fn.align_of_val.html deleted file mode 100644 index e819579d..00000000 --- a/libc/dox/imp/mem/fn.align_of_val.html +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - -Redirecting to ../../../../core/mem/fn.align_of_val.html...
- - - \ No newline at end of file diff --git a/libc/dox/imp/mem/fn.drop.html b/libc/dox/imp/mem/fn.drop.html deleted file mode 100644 index 667f00c4..00000000 --- a/libc/dox/imp/mem/fn.drop.html +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - -Redirecting to ../../../../core/mem/fn.drop.html...
- - - \ No newline at end of file diff --git a/libc/dox/imp/mem/fn.dropped.html b/libc/dox/imp/mem/fn.dropped.html deleted file mode 100644 index 5b62ab76..00000000 --- a/libc/dox/imp/mem/fn.dropped.html +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - -Redirecting to ../../../../core/mem/fn.dropped.html...
- - - \ No newline at end of file diff --git a/libc/dox/imp/mem/fn.forget.html b/libc/dox/imp/mem/fn.forget.html deleted file mode 100644 index 1f494a74..00000000 --- a/libc/dox/imp/mem/fn.forget.html +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - -Redirecting to ../../../../core/mem/fn.forget.html...
- - - \ No newline at end of file diff --git a/libc/dox/imp/mem/fn.min_align_of.html b/libc/dox/imp/mem/fn.min_align_of.html deleted file mode 100644 index 182eab5b..00000000 --- a/libc/dox/imp/mem/fn.min_align_of.html +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - -Redirecting to ../../../../core/mem/fn.min_align_of.html...
- - - \ No newline at end of file diff --git a/libc/dox/imp/mem/fn.min_align_of_val.html b/libc/dox/imp/mem/fn.min_align_of_val.html deleted file mode 100644 index 3801872e..00000000 --- a/libc/dox/imp/mem/fn.min_align_of_val.html +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - -Redirecting to ../../../../core/mem/fn.min_align_of_val.html...
- - - \ No newline at end of file diff --git a/libc/dox/imp/mem/fn.replace.html b/libc/dox/imp/mem/fn.replace.html deleted file mode 100644 index d11bc2d3..00000000 --- a/libc/dox/imp/mem/fn.replace.html +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - -Redirecting to ../../../../core/mem/fn.replace.html...
- - - \ No newline at end of file diff --git a/libc/dox/imp/mem/fn.size_of.html b/libc/dox/imp/mem/fn.size_of.html deleted file mode 100644 index 8bd0d6c5..00000000 --- a/libc/dox/imp/mem/fn.size_of.html +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - -Redirecting to ../../../../core/mem/fn.size_of.html...
- - - \ No newline at end of file diff --git a/libc/dox/imp/mem/fn.size_of_val.html b/libc/dox/imp/mem/fn.size_of_val.html deleted file mode 100644 index 879d9042..00000000 --- a/libc/dox/imp/mem/fn.size_of_val.html +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - -Redirecting to ../../../../core/mem/fn.size_of_val.html...
- - - \ No newline at end of file diff --git a/libc/dox/imp/mem/fn.swap.html b/libc/dox/imp/mem/fn.swap.html deleted file mode 100644 index 4e6731eb..00000000 --- a/libc/dox/imp/mem/fn.swap.html +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - -Redirecting to ../../../../core/mem/fn.swap.html...
- - - \ No newline at end of file diff --git a/libc/dox/imp/mem/fn.transmute.html b/libc/dox/imp/mem/fn.transmute.html deleted file mode 100644 index da75cf11..00000000 --- a/libc/dox/imp/mem/fn.transmute.html +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - -Redirecting to ../../../../core/intrinsics/fn.transmute.html...
- - - \ No newline at end of file diff --git a/libc/dox/imp/mem/fn.transmute_copy.html b/libc/dox/imp/mem/fn.transmute_copy.html deleted file mode 100644 index 57a56710..00000000 --- a/libc/dox/imp/mem/fn.transmute_copy.html +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - -Redirecting to ../../../../core/mem/fn.transmute_copy.html...
- - - \ No newline at end of file diff --git a/libc/dox/imp/mem/fn.uninitialized.html b/libc/dox/imp/mem/fn.uninitialized.html deleted file mode 100644 index 08905660..00000000 --- a/libc/dox/imp/mem/fn.uninitialized.html +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - -Redirecting to ../../../../core/mem/fn.uninitialized.html...
- - - \ No newline at end of file diff --git a/libc/dox/imp/mem/fn.zeroed.html b/libc/dox/imp/mem/fn.zeroed.html deleted file mode 100644 index c6fdeb1a..00000000 --- a/libc/dox/imp/mem/fn.zeroed.html +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - -Redirecting to ../../../../core/mem/fn.zeroed.html...
- - - \ No newline at end of file diff --git a/libc/dox/imp/mem/index.html b/libc/dox/imp/mem/index.html deleted file mode 100644 index 3b288d56..00000000 --- a/libc/dox/imp/mem/index.html +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - -Redirecting to ../../../../core/mem/index.html...
- - - \ No newline at end of file diff --git a/libc/dox/imp/trait.Clone.html b/libc/dox/imp/trait.Clone.html deleted file mode 100644 index aa1c3790..00000000 --- a/libc/dox/imp/trait.Clone.html +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - -Redirecting to ../../../core/clone/trait.Clone.html...
- - - \ No newline at end of file diff --git a/libc/dox/imp/trait.Copy.html b/libc/dox/imp/trait.Copy.html deleted file mode 100644 index f4c0356e..00000000 --- a/libc/dox/imp/trait.Copy.html +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - -Redirecting to ../../../core/marker/trait.Copy.html...
- - - \ No newline at end of file diff --git a/libc/dox/mem/constant.POST_DROP_U16.html b/libc/dox/mem/constant.POST_DROP_U16.html deleted file mode 100644 index 82666883..00000000 --- a/libc/dox/mem/constant.POST_DROP_U16.html +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - -Redirecting to ../../../core/mem/constant.POST_DROP_U16.html...
- - - \ No newline at end of file diff --git a/libc/dox/mem/constant.POST_DROP_U32.html b/libc/dox/mem/constant.POST_DROP_U32.html deleted file mode 100644 index d8f5eee7..00000000 --- a/libc/dox/mem/constant.POST_DROP_U32.html +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - -Redirecting to ../../../core/mem/constant.POST_DROP_U32.html...
- - - \ No newline at end of file diff --git a/libc/dox/mem/constant.POST_DROP_U64.html b/libc/dox/mem/constant.POST_DROP_U64.html deleted file mode 100644 index 3812e4ca..00000000 --- a/libc/dox/mem/constant.POST_DROP_U64.html +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - -Redirecting to ../../../core/mem/constant.POST_DROP_U64.html...
- - - \ No newline at end of file diff --git a/libc/dox/mem/constant.POST_DROP_U8.html b/libc/dox/mem/constant.POST_DROP_U8.html deleted file mode 100644 index 1c5f926c..00000000 --- a/libc/dox/mem/constant.POST_DROP_U8.html +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - -Redirecting to ../../../core/mem/constant.POST_DROP_U8.html...
- - - \ No newline at end of file diff --git a/libc/dox/mem/constant.POST_DROP_USIZE.html b/libc/dox/mem/constant.POST_DROP_USIZE.html deleted file mode 100644 index 132c16fd..00000000 --- a/libc/dox/mem/constant.POST_DROP_USIZE.html +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - -Redirecting to ../../../core/mem/constant.POST_DROP_USIZE.html...
- - - \ No newline at end of file diff --git a/libc/dox/mem/fn.align_of.html b/libc/dox/mem/fn.align_of.html deleted file mode 100644 index 3b9de89e..00000000 --- a/libc/dox/mem/fn.align_of.html +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - -Redirecting to ../../../core/mem/fn.align_of.html...
- - - \ No newline at end of file diff --git a/libc/dox/mem/fn.align_of_val.html b/libc/dox/mem/fn.align_of_val.html deleted file mode 100644 index d0378e16..00000000 --- a/libc/dox/mem/fn.align_of_val.html +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - -Redirecting to ../../../core/mem/fn.align_of_val.html...
- - - \ No newline at end of file diff --git a/libc/dox/mem/fn.drop.html b/libc/dox/mem/fn.drop.html deleted file mode 100644 index f238d0c3..00000000 --- a/libc/dox/mem/fn.drop.html +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - -Redirecting to ../../../core/mem/fn.drop.html...
- - - \ No newline at end of file diff --git a/libc/dox/mem/fn.dropped.html b/libc/dox/mem/fn.dropped.html deleted file mode 100644 index 8787366b..00000000 --- a/libc/dox/mem/fn.dropped.html +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - -Redirecting to ../../../core/mem/fn.dropped.html...
- - - \ No newline at end of file diff --git a/libc/dox/mem/fn.forget.html b/libc/dox/mem/fn.forget.html deleted file mode 100644 index 934568c3..00000000 --- a/libc/dox/mem/fn.forget.html +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - -Redirecting to ../../../core/mem/fn.forget.html...
- - - \ No newline at end of file diff --git a/libc/dox/mem/fn.min_align_of.html b/libc/dox/mem/fn.min_align_of.html deleted file mode 100644 index a54e8b08..00000000 --- a/libc/dox/mem/fn.min_align_of.html +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - -Redirecting to ../../../core/mem/fn.min_align_of.html...
- - - \ No newline at end of file diff --git a/libc/dox/mem/fn.min_align_of_val.html b/libc/dox/mem/fn.min_align_of_val.html deleted file mode 100644 index 20d49d17..00000000 --- a/libc/dox/mem/fn.min_align_of_val.html +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - -Redirecting to ../../../core/mem/fn.min_align_of_val.html...
- - - \ No newline at end of file diff --git a/libc/dox/mem/fn.replace.html b/libc/dox/mem/fn.replace.html deleted file mode 100644 index d6ddbc11..00000000 --- a/libc/dox/mem/fn.replace.html +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - -Redirecting to ../../../core/mem/fn.replace.html...
- - - \ No newline at end of file diff --git a/libc/dox/mem/fn.size_of.html b/libc/dox/mem/fn.size_of.html deleted file mode 100644 index f9848975..00000000 --- a/libc/dox/mem/fn.size_of.html +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - -Redirecting to ../../../core/mem/fn.size_of.html...
- - - \ No newline at end of file diff --git a/libc/dox/mem/fn.size_of_val.html b/libc/dox/mem/fn.size_of_val.html deleted file mode 100644 index 1a7b94f2..00000000 --- a/libc/dox/mem/fn.size_of_val.html +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - -Redirecting to ../../../core/mem/fn.size_of_val.html...
- - - \ No newline at end of file diff --git a/libc/dox/mem/fn.swap.html b/libc/dox/mem/fn.swap.html deleted file mode 100644 index 7ea0f411..00000000 --- a/libc/dox/mem/fn.swap.html +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - -Redirecting to ../../../core/mem/fn.swap.html...
- - - \ No newline at end of file diff --git a/libc/dox/mem/fn.transmute.html b/libc/dox/mem/fn.transmute.html deleted file mode 100644 index 21f6487a..00000000 --- a/libc/dox/mem/fn.transmute.html +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - -Redirecting to ../../../core/intrinsics/fn.transmute.html...
- - - \ No newline at end of file diff --git a/libc/dox/mem/fn.transmute_copy.html b/libc/dox/mem/fn.transmute_copy.html deleted file mode 100644 index df1c28a7..00000000 --- a/libc/dox/mem/fn.transmute_copy.html +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - -Redirecting to ../../../core/mem/fn.transmute_copy.html...
- - - \ No newline at end of file diff --git a/libc/dox/mem/fn.uninitialized.html b/libc/dox/mem/fn.uninitialized.html deleted file mode 100644 index 1dbddda2..00000000 --- a/libc/dox/mem/fn.uninitialized.html +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - -Redirecting to ../../../core/mem/fn.uninitialized.html...
- - - \ No newline at end of file diff --git a/libc/dox/mem/fn.zeroed.html b/libc/dox/mem/fn.zeroed.html deleted file mode 100644 index 7caa2803..00000000 --- a/libc/dox/mem/fn.zeroed.html +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - -Redirecting to ../../../core/mem/fn.zeroed.html...
- - - \ No newline at end of file diff --git a/libc/dox/mem/index.html b/libc/dox/mem/index.html deleted file mode 100644 index a1b3e6b5..00000000 --- a/libc/dox/mem/index.html +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - -Redirecting to ../../../core/mem/index.html...
- - - \ No newline at end of file diff --git a/libc/dox/trait.Clone.html b/libc/dox/trait.Clone.html deleted file mode 100644 index e72a9271..00000000 --- a/libc/dox/trait.Clone.html +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - -Redirecting to ../../core/clone/trait.Clone.html...
- - - \ No newline at end of file diff --git a/libc/dox/trait.Copy.html b/libc/dox/trait.Copy.html deleted file mode 100644 index f5b31b47..00000000 --- a/libc/dox/trait.Copy.html +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - -Redirecting to ../../core/marker/trait.Copy.html...
- - - \ No newline at end of file diff --git a/libc/fn.glob.html b/libc/fn.glob.html index fb552ed4..7eb0c730 100644 --- a/libc/fn.glob.html +++ b/libc/fn.glob.html @@ -48,7 +48,7 @@ [−] [src] -pub unsafe extern fn glob(pattern: *const c_char, flags: c_int, errfunc: Option<extern fn(epath: *const c_char, errno: c_int) -> c_int>, pglob: *mut glob_t) -> c_int+pub unsafe extern fn glob(pattern: *const c_char, flags: c_int, errfunc: Option<extern fn(epath: *const c_char, errno: c_int) -> c_int>, pglob: *mut glob_t) -> c_intdiff --git a/libc/fn.glob64.html b/libc/fn.glob64.html index d2e62eaf..a4e45fb7 100644 --- a/libc/fn.glob64.html +++ b/libc/fn.glob64.html @@ -48,7 +48,7 @@ [−] [src] -pub unsafe extern fn glob64(pattern: *const c_char, flags: c_int, errfunc: Option<extern fn(epath: *const c_char, errno: c_int) -> c_int>, pglob: *mut glob64_t) -> c_int+pub unsafe extern fn glob64(pattern: *const c_char, flags: c_int, errfunc: Option<extern fn(epath: *const c_char, errno: c_int) -> c_int>, pglob: *mut glob64_t) -> c_intdiff --git a/libc/fn.pthread_key_create.html b/libc/fn.pthread_key_create.html index 7601e1f2..bd8c7fca 100644 --- a/libc/fn.pthread_key_create.html +++ b/libc/fn.pthread_key_create.html @@ -48,7 +48,7 @@ [−] [src] -pub unsafe extern fn pthread_key_create(key: *mut pthread_key_t, dtor: Option<unsafe extern fn(*mut c_void)>) -> c_int+pub unsafe extern fn pthread_key_create(key: *mut pthread_key_t, dtor: Option<unsafe extern fn(*mut c_void)>) -> c_intdiff --git a/libc/struct.Dl_info.html b/libc/struct.Dl_info.html index e1dae9e3..986d7d00 100644 --- a/libc/struct.Dl_info.html +++ b/libc/struct.Dl_info.html @@ -57,12 +57,12 @@dli_fbase: *mut c_void
dli_sname: *const c_char
dli_saddr: *mut c_void
-Trait Implementations
-
impl Copy for Dl_info
[src]-
impl Clone for Dl_info
[src]-
fn clone(&self) -> Dl_info
Returns a copy of the value. Read more
--
fn clone_from(&mut self, source: &Self)
1.0.0Performs copy-assignment from
+source
. Read moreTrait Implementations
+
impl Copy for Dl_info
[src]+
impl Clone for Dl_info
[src]diff --git a/libc/struct.__exit_status.html b/libc/struct.__exit_status.html index f7c45896..bdd73385 100644 --- a/libc/struct.__exit_status.html +++ b/libc/struct.__exit_status.html @@ -53,12 +53,12 @@ pub e_exit: c_short, }+
fn clone(&self) -> Dl_info
Returns a copy of the value. Read more
++
fn clone_from(&mut self, source: &Self)
1.0.0Performs copy-assignment from
source
. Read moreFields
e_termination: c_short
e_exit: c_short
-Trait Implementations
-
impl Copy for __exit_status
[src]-
impl Clone for __exit_status
[src]-
fn clone(&self) -> __exit_status
Returns a copy of the value. Read more
--
fn clone_from(&mut self, source: &Self)
1.0.0Performs copy-assignment from
+source
. Read moreTrait Implementations
+
impl Copy for __exit_status
[src]+
impl Clone for __exit_status
[src]diff --git a/libc/struct.__timeval.html b/libc/struct.__timeval.html index 41965442..a4380790 100644 --- a/libc/struct.__timeval.html +++ b/libc/struct.__timeval.html @@ -53,12 +53,12 @@ pub tv_usec: int32_t, }+
fn clone(&self) -> __exit_status
Returns a copy of the value. Read more
++
fn clone_from(&mut self, source: &Self)
1.0.0Performs copy-assignment from
source
. Read moreFields
tv_sec: int32_t
tv_usec: int32_t
-Trait Implementations
-
impl Copy for __timeval
[src]-
impl Clone for __timeval
[src]-
fn clone(&self) -> __timeval
Returns a copy of the value. Read more
--
fn clone_from(&mut self, source: &Self)
1.0.0Performs copy-assignment from
+source
. Read moreTrait Implementations
+
impl Copy for __timeval
[src]+
impl Clone for __timeval
[src]diff --git a/libc/struct._libc_fpstate.html b/libc/struct._libc_fpstate.html index be59da2b..358b1639 100644 --- a/libc/struct._libc_fpstate.html +++ b/libc/struct._libc_fpstate.html @@ -70,12 +70,12 @@+
fn clone(&self) -> __timeval
Returns a copy of the value. Read more
++
fn clone_from(&mut self, source: &Self)
1.0.0Performs copy-assignment from
source
. Read moremxcr_mask: u32
_st: [_libc_fpxreg; 8]
_xmm: [_libc_xmmreg; 16]
-Trait Implementations
-
impl Copy for _libc_fpstate
[src]-
impl Clone for _libc_fpstate
[src]-
fn clone(&self) -> _libc_fpstate
Returns a copy of the value. Read more
--
fn clone_from(&mut self, source: &Self)
1.0.0Performs copy-assignment from
+source
. Read moreTrait Implementations
+
impl Copy for _libc_fpstate
[src]+
impl Clone for _libc_fpstate
[src]diff --git a/libc/struct._libc_fpxreg.html b/libc/struct._libc_fpxreg.html index f58d94fc..8650c3ae 100644 --- a/libc/struct._libc_fpxreg.html +++ b/libc/struct._libc_fpxreg.html @@ -54,12 +54,12 @@ // some fields omitted }+
fn clone(&self) -> _libc_fpstate
Returns a copy of the value. Read more
++
fn clone_from(&mut self, source: &Self)
1.0.0Performs copy-assignment from
source
. Read moreFields
significand: [u16; 4]
exponent: u16
-Trait Implementations
-
impl Copy for _libc_fpxreg
[src]-
impl Clone for _libc_fpxreg
[src]-
fn clone(&self) -> _libc_fpxreg
Returns a copy of the value. Read more
--
fn clone_from(&mut self, source: &Self)
1.0.0Performs copy-assignment from
+source
. Read moreTrait Implementations
+
impl Copy for _libc_fpxreg
[src]+
impl Clone for _libc_fpxreg
[src]diff --git a/libc/struct._libc_xmmreg.html b/libc/struct._libc_xmmreg.html index cf4efb91..aa5bf500 100644 --- a/libc/struct._libc_xmmreg.html +++ b/libc/struct._libc_xmmreg.html @@ -51,12 +51,12 @@+
fn clone(&self) -> _libc_fpxreg
Returns a copy of the value. Read more
++
fn clone_from(&mut self, source: &Self)
1.0.0Performs copy-assignment from
source
. Read morepub struct _libc_xmmreg { pub element: [u32; 4], }Fields
element: [u32; 4]
-Trait Implementations
-
impl Copy for _libc_xmmreg
[src]-
impl Clone for _libc_xmmreg
[src]-
fn clone(&self) -> _libc_xmmreg
Returns a copy of the value. Read more
--
fn clone_from(&mut self, source: &Self)
1.0.0Performs copy-assignment from
+source
. Read moreTrait Implementations
+
impl Copy for _libc_xmmreg
[src]+
impl Clone for _libc_xmmreg
[src]diff --git a/libc/struct.addrinfo.html b/libc/struct.addrinfo.html index 59764e45..c76e19bb 100644 --- a/libc/struct.addrinfo.html +++ b/libc/struct.addrinfo.html @@ -65,12 +65,12 @@+
fn clone(&self) -> _libc_xmmreg
Returns a copy of the value. Read more
++
fn clone_from(&mut self, source: &Self)
1.0.0Performs copy-assignment from
source
. Read moreai_addr: *mut sockaddr
ai_canonname: *mut c_char
ai_next: *mut addrinfo
-Trait Implementations
-
impl Copy for addrinfo
[src]-
impl Clone for addrinfo
[src]-
fn clone(&self) -> addrinfo
Returns a copy of the value. Read more
--
fn clone_from(&mut self, source: &Self)
1.0.0Performs copy-assignment from
+source
. Read moreTrait Implementations
+
impl Copy for addrinfo
[src]+
impl Clone for addrinfo
[src]diff --git a/libc/struct.cpu_set_t.html b/libc/struct.cpu_set_t.html index 4b2466e6..fbceb986 100644 --- a/libc/struct.cpu_set_t.html +++ b/libc/struct.cpu_set_t.html @@ -50,12 +50,12 @@ [src]+
fn clone(&self) -> addrinfo
Returns a copy of the value. Read more
++
fn clone_from(&mut self, source: &Self)
1.0.0Performs copy-assignment from
source
. Read morepub struct cpu_set_t { // some fields omitted -}Trait Implementations
-
impl Copy for cpu_set_t
[src]-
impl Clone for cpu_set_t
[src]-
fn clone(&self) -> cpu_set_t
Returns a copy of the value. Read more
--
fn clone_from(&mut self, source: &Self)
1.0.0Performs copy-assignment from
+}source
. Read moreTrait Implementations
+
impl Copy for cpu_set_t
[src]+
impl Clone for cpu_set_t
[src]diff --git a/libc/struct.dirent.html b/libc/struct.dirent.html index 5d96d7d1..96e70110 100644 --- a/libc/struct.dirent.html +++ b/libc/struct.dirent.html @@ -59,12 +59,12 @@+
fn clone(&self) -> cpu_set_t
Returns a copy of the value. Read more
++
fn clone_from(&mut self, source: &Self)
1.0.0Performs copy-assignment from
source
. Read mored_reclen: c_ushort
d_type: c_uchar
d_name: [c_char; 256]
-Trait Implementations
-
impl Copy for dirent
[src]-
impl Clone for dirent
[src]-
fn clone(&self) -> dirent
Returns a copy of the value. Read more
--
fn clone_from(&mut self, source: &Self)
1.0.0Performs copy-assignment from
+source
. Read moreTrait Implementations
+
impl Copy for dirent
[src]+
impl Clone for dirent
[src]diff --git a/libc/struct.dirent64.html b/libc/struct.dirent64.html index bb079e51..ce7994ac 100644 --- a/libc/struct.dirent64.html +++ b/libc/struct.dirent64.html @@ -59,12 +59,12 @@+
fn clone(&self) -> dirent
Returns a copy of the value. Read more
++
fn clone_from(&mut self, source: &Self)
1.0.0Performs copy-assignment from
source
. Read mored_reclen: c_ushort
d_type: c_uchar
d_name: [c_char; 256]
-Trait Implementations
-
impl Copy for dirent64
[src]-
impl Clone for dirent64
[src]-
fn clone(&self) -> dirent64
Returns a copy of the value. Read more
--
fn clone_from(&mut self, source: &Self)
1.0.0Performs copy-assignment from
+source
. Read moreTrait Implementations
+
impl Copy for dirent64
[src]+
impl Clone for dirent64
[src]diff --git a/libc/struct.dqblk.html b/libc/struct.dqblk.html index 82056d9b..dd928d08 100644 --- a/libc/struct.dqblk.html +++ b/libc/struct.dqblk.html @@ -67,12 +67,12 @@+
fn clone(&self) -> dirent64
Returns a copy of the value. Read more
++
fn clone_from(&mut self, source: &Self)
1.0.0Performs copy-assignment from
source
. Read moredqb_btime: uint64_t
dqb_itime: uint64_t
dqb_valid: uint32_t
-Trait Implementations
-
impl Copy for dqblk
[src]-
impl Clone for dqblk
[src]-
fn clone(&self) -> dqblk
Returns a copy of the value. Read more
--
fn clone_from(&mut self, source: &Self)
1.0.0Performs copy-assignment from
+source
. Read moreTrait Implementations
+
impl Copy for dqblk
[src]+
impl Clone for dqblk
[src]diff --git a/libc/struct.epoll_event.html b/libc/struct.epoll_event.html index 81fc286c..08f155c5 100644 --- a/libc/struct.epoll_event.html +++ b/libc/struct.epoll_event.html @@ -53,12 +53,12 @@ pub u64: uint64_t, }+
fn clone(&self) -> dqblk
Returns a copy of the value. Read more
++
fn clone_from(&mut self, source: &Self)
1.0.0Performs copy-assignment from
source
. Read moreFields
events: uint32_t
u64: uint64_t
-Trait Implementations
-
impl Copy for epoll_event
[src]-
impl Clone for epoll_event
[src]-
fn clone(&self) -> epoll_event
Returns a copy of the value. Read more
--
fn clone_from(&mut self, source: &Self)
1.0.0Performs copy-assignment from
+source
. Read moreTrait Implementations
+
impl Copy for epoll_event
[src]+
impl Clone for epoll_event
[src]diff --git a/libc/struct.fd_set.html b/libc/struct.fd_set.html index acdab9c3..1592c641 100644 --- a/libc/struct.fd_set.html +++ b/libc/struct.fd_set.html @@ -50,12 +50,12 @@ [src]+
fn clone(&self) -> epoll_event
Returns a copy of the value. Read more
++
fn clone_from(&mut self, source: &Self)
1.0.0Performs copy-assignment from
source
. Read morepub struct fd_set { // some fields omitted -}Trait Implementations
-
impl Copy for fd_set
[src]-
impl Clone for fd_set
[src]-
fn clone(&self) -> fd_set
Returns a copy of the value. Read more
--
fn clone_from(&mut self, source: &Self)
1.0.0Performs copy-assignment from
+}source
. Read moreTrait Implementations
+
impl Copy for fd_set
[src]+
impl Clone for fd_set
[src]diff --git a/libc/struct.flock.html b/libc/struct.flock.html index 670389f8..9f2e5d42 100644 --- a/libc/struct.flock.html +++ b/libc/struct.flock.html @@ -59,12 +59,12 @@+
fn clone(&self) -> fd_set
Returns a copy of the value. Read more
++
fn clone_from(&mut self, source: &Self)
1.0.0Performs copy-assignment from
source
. Read morel_start: off_t
l_len: off_t
l_pid: pid_t
-Trait Implementations
-
impl Copy for flock
[src]-
impl Clone for flock
[src]-
fn clone(&self) -> flock
Returns a copy of the value. Read more
--
fn clone_from(&mut self, source: &Self)
1.0.0Performs copy-assignment from
+source
. Read moreTrait Implementations
+
impl Copy for flock
[src]+
impl Clone for flock
[src]diff --git a/libc/struct.fsid_t.html b/libc/struct.fsid_t.html index 11a1327c..2cfce1d8 100644 --- a/libc/struct.fsid_t.html +++ b/libc/struct.fsid_t.html @@ -50,12 +50,12 @@ [src]+
fn clone(&self) -> flock
Returns a copy of the value. Read more
++
fn clone_from(&mut self, source: &Self)
1.0.0Performs copy-assignment from
source
. Read morepub struct fsid_t { // some fields omitted -}Trait Implementations
-
impl Copy for fsid_t
[src]-
impl Clone for fsid_t
[src]-
fn clone(&self) -> fsid_t
Returns a copy of the value. Read more
--
fn clone_from(&mut self, source: &Self)
1.0.0Performs copy-assignment from
+}source
. Read moreTrait Implementations
+
impl Copy for fsid_t
[src]+
impl Clone for fsid_t
[src]diff --git a/libc/struct.glob64_t.html b/libc/struct.glob64_t.html index e18acd4b..0fd10d79 100644 --- a/libc/struct.glob64_t.html +++ b/libc/struct.glob64_t.html @@ -58,12 +58,12 @@+
fn clone(&self) -> fsid_t
Returns a copy of the value. Read more
++
fn clone_from(&mut self, source: &Self)
1.0.0Performs copy-assignment from
source
. Read moregl_pathv: *mut *mut c_char
gl_offs: size_t
gl_flags: c_int
-Trait Implementations
-
impl Copy for glob64_t
[src]-
impl Clone for glob64_t
[src]-
fn clone(&self) -> glob64_t
Returns a copy of the value. Read more
--
fn clone_from(&mut self, source: &Self)
1.0.0Performs copy-assignment from
+source
. Read moreTrait Implementations
+
impl Copy for glob64_t
[src]+
impl Clone for glob64_t
[src]diff --git a/libc/struct.glob_t.html b/libc/struct.glob_t.html index 55183fc0..b0e7e19c 100644 --- a/libc/struct.glob_t.html +++ b/libc/struct.glob_t.html @@ -58,12 +58,12 @@+
fn clone(&self) -> glob64_t
Returns a copy of the value. Read more
++
fn clone_from(&mut self, source: &Self)
1.0.0Performs copy-assignment from
source
. Read moregl_pathv: *mut *mut c_char
gl_offs: size_t
gl_flags: c_int
-Trait Implementations
-
impl Copy for glob_t
[src]-
impl Clone for glob_t
[src]-
fn clone(&self) -> glob_t
Returns a copy of the value. Read more
--
fn clone_from(&mut self, source: &Self)
1.0.0Performs copy-assignment from
+source
. Read moreTrait Implementations
+
impl Copy for glob_t
[src]+
impl Clone for glob_t
[src]diff --git a/libc/struct.group.html b/libc/struct.group.html index 46c1bde7..bd9590c4 100644 --- a/libc/struct.group.html +++ b/libc/struct.group.html @@ -57,12 +57,12 @@+
fn clone(&self) -> glob_t
Returns a copy of the value. Read more
++
fn clone_from(&mut self, source: &Self)
1.0.0Performs copy-assignment from
source
. Read moregr_passwd: *mut c_char
gr_gid: gid_t
gr_mem: *mut *mut c_char
-Trait Implementations
-
impl Copy for group
[src]-
impl Clone for group
[src]-
fn clone(&self) -> group
Returns a copy of the value. Read more
--
fn clone_from(&mut self, source: &Self)
1.0.0Performs copy-assignment from
+source
. Read moreTrait Implementations
+
impl Copy for group
[src]+
impl Clone for group
[src]diff --git a/libc/struct.hostent.html b/libc/struct.hostent.html index 37911497..a54fcd70 100644 --- a/libc/struct.hostent.html +++ b/libc/struct.hostent.html @@ -59,12 +59,12 @@+
fn clone(&self) -> group
Returns a copy of the value. Read more
++
fn clone_from(&mut self, source: &Self)
1.0.0Performs copy-assignment from
source
. Read moreh_addrtype: c_int
h_length: c_int
h_addr_list: *mut *mut c_char
-Trait Implementations
-
impl Copy for hostent
[src]-
impl Clone for hostent
[src]-
fn clone(&self) -> hostent
Returns a copy of the value. Read more
--
fn clone_from(&mut self, source: &Self)
1.0.0Performs copy-assignment from
+source
. Read moreTrait Implementations
+
impl Copy for hostent
[src]+
impl Clone for hostent
[src]diff --git a/libc/struct.if_nameindex.html b/libc/struct.if_nameindex.html index bdb6a307..49612a35 100644 --- a/libc/struct.if_nameindex.html +++ b/libc/struct.if_nameindex.html @@ -53,12 +53,12 @@ pub if_name: *mut c_char, }+
fn clone(&self) -> hostent
Returns a copy of the value. Read more
++
fn clone_from(&mut self, source: &Self)
1.0.0Performs copy-assignment from
source
. Read moreFields
if_index: c_uint
if_name: *mut c_char
-Trait Implementations
-
impl Copy for if_nameindex
[src]-
impl Clone for if_nameindex
[src]-
fn clone(&self) -> if_nameindex
Returns a copy of the value. Read more
--
fn clone_from(&mut self, source: &Self)
1.0.0Performs copy-assignment from
+source
. Read moreTrait Implementations
+
impl Copy for if_nameindex
[src]+
impl Clone for if_nameindex
[src]diff --git a/libc/struct.ifaddrs.html b/libc/struct.ifaddrs.html index 60da5e9f..88246a05 100644 --- a/libc/struct.ifaddrs.html +++ b/libc/struct.ifaddrs.html @@ -63,12 +63,12 @@+
fn clone(&self) -> if_nameindex
Returns a copy of the value. Read more
++
fn clone_from(&mut self, source: &Self)
1.0.0Performs copy-assignment from
source
. Read moreifa_netmask: *mut sockaddr
ifa_ifu: *mut sockaddr
ifa_data: *mut c_void
-Trait Implementations
-
impl Copy for ifaddrs
[src]-
impl Clone for ifaddrs
[src]-
fn clone(&self) -> ifaddrs
Returns a copy of the value. Read more
--
fn clone_from(&mut self, source: &Self)
1.0.0Performs copy-assignment from
+source
. Read moreTrait Implementations
+
impl Copy for ifaddrs
[src]+
impl Clone for ifaddrs
[src]diff --git a/libc/struct.in6_addr.html b/libc/struct.in6_addr.html index 7d794471..ca0f846c 100644 --- a/libc/struct.in6_addr.html +++ b/libc/struct.in6_addr.html @@ -52,12 +52,12 @@ pub s6_addr: [u8; 16], // some fields omitted }+
fn clone(&self) -> ifaddrs
Returns a copy of the value. Read more
++
fn clone_from(&mut self, source: &Self)
1.0.0Performs copy-assignment from
source
. Read moreFields
s6_addr: [u8; 16]
-Trait Implementations
-
impl Copy for in6_addr
[src]-
impl Clone for in6_addr
[src]-
fn clone(&self) -> in6_addr
Returns a copy of the value. Read more
--
fn clone_from(&mut self, source: &Self)
1.0.0Performs copy-assignment from
+source
. Read moreTrait Implementations
+
impl Copy for in6_addr
[src]+
impl Clone for in6_addr
[src]diff --git a/libc/struct.in_addr.html b/libc/struct.in_addr.html index 3c3dc2fa..8b3d6733 100644 --- a/libc/struct.in_addr.html +++ b/libc/struct.in_addr.html @@ -51,12 +51,12 @@+
fn clone(&self) -> in6_addr
Returns a copy of the value. Read more
++
fn clone_from(&mut self, source: &Self)
1.0.0Performs copy-assignment from
source
. Read morepub struct in_addr { pub s_addr: in_addr_t, }Fields
s_addr: in_addr_t
-Trait Implementations
-
impl Copy for in_addr
[src]-
impl Clone for in_addr
[src]-
fn clone(&self) -> in_addr
Returns a copy of the value. Read more
--
fn clone_from(&mut self, source: &Self)
1.0.0Performs copy-assignment from
+source
. Read moreTrait Implementations
+
impl Copy for in_addr
[src]+
impl Clone for in_addr
[src]diff --git a/libc/struct.iovec.html b/libc/struct.iovec.html index 43b27992..b5094d33 100644 --- a/libc/struct.iovec.html +++ b/libc/struct.iovec.html @@ -53,12 +53,12 @@ pub iov_len: size_t, }+
fn clone(&self) -> in_addr
Returns a copy of the value. Read more
++
fn clone_from(&mut self, source: &Self)
1.0.0Performs copy-assignment from
source
. Read moreFields
iov_base: *mut c_void
iov_len: size_t
-Trait Implementations
-
impl Copy for iovec
[src]-
impl Clone for iovec
[src]-
fn clone(&self) -> iovec
Returns a copy of the value. Read more
--
fn clone_from(&mut self, source: &Self)
1.0.0Performs copy-assignment from
+source
. Read moreTrait Implementations
+
impl Copy for iovec
[src]+
impl Clone for iovec
[src]diff --git a/libc/struct.ip_mreq.html b/libc/struct.ip_mreq.html index 501b2a92..584723de 100644 --- a/libc/struct.ip_mreq.html +++ b/libc/struct.ip_mreq.html @@ -53,12 +53,12 @@ pub imr_interface: in_addr, }+
fn clone(&self) -> iovec
Returns a copy of the value. Read more
++
fn clone_from(&mut self, source: &Self)
1.0.0Performs copy-assignment from
source
. Read moreFields
imr_multiaddr: in_addr
imr_interface: in_addr
-Trait Implementations
-
impl Copy for ip_mreq
[src]-
impl Clone for ip_mreq
[src]-
fn clone(&self) -> ip_mreq
Returns a copy of the value. Read more
--
fn clone_from(&mut self, source: &Self)
1.0.0Performs copy-assignment from
+source
. Read moreTrait Implementations
+
impl Copy for ip_mreq
[src]+
impl Clone for ip_mreq
[src]diff --git a/libc/struct.ipc_perm.html b/libc/struct.ipc_perm.html index dca9b78f..53106a98 100644 --- a/libc/struct.ipc_perm.html +++ b/libc/struct.ipc_perm.html @@ -64,12 +64,12 @@+
fn clone(&self) -> ip_mreq
Returns a copy of the value. Read more
++
fn clone_from(&mut self, source: &Self)
1.0.0Performs copy-assignment from
source
. Read morecgid: gid_t
mode: c_ushort
__seq: c_ushort
-Trait Implementations
-
impl Copy for ipc_perm
[src]-
impl Clone for ipc_perm
[src]-
fn clone(&self) -> ipc_perm
Returns a copy of the value. Read more
--
fn clone_from(&mut self, source: &Self)
1.0.0Performs copy-assignment from
+source
. Read moreTrait Implementations
+
impl Copy for ipc_perm
[src]+
impl Clone for ipc_perm
[src]diff --git a/libc/struct.ipv6_mreq.html b/libc/struct.ipv6_mreq.html index 82bbee85..3b13c1d0 100644 --- a/libc/struct.ipv6_mreq.html +++ b/libc/struct.ipv6_mreq.html @@ -53,12 +53,12 @@ pub ipv6mr_interface: c_uint, }+
fn clone(&self) -> ipc_perm
Returns a copy of the value. Read more
++
fn clone_from(&mut self, source: &Self)
1.0.0Performs copy-assignment from
source
. Read moreFields
ipv6mr_multiaddr: in6_addr
ipv6mr_interface: c_uint
-Trait Implementations
-
impl Copy for ipv6_mreq
[src]-
impl Clone for ipv6_mreq
[src]-
fn clone(&self) -> ipv6_mreq
Returns a copy of the value. Read more
--
fn clone_from(&mut self, source: &Self)
1.0.0Performs copy-assignment from
+source
. Read moreTrait Implementations
+
impl Copy for ipv6_mreq
[src]+
impl Clone for ipv6_mreq
[src]diff --git a/libc/struct.lconv.html b/libc/struct.lconv.html index 6b8e5d08..f4c8d8ee 100644 --- a/libc/struct.lconv.html +++ b/libc/struct.lconv.html @@ -97,12 +97,12 @@+
fn clone(&self) -> ipv6_mreq
Returns a copy of the value. Read more
++
fn clone_from(&mut self, source: &Self)
1.0.0Performs copy-assignment from
source
. Read moreint_n_sep_by_space: c_char
int_p_sign_posn: c_char
int_n_sign_posn: c_char
-Trait Implementations
-
impl Copy for lconv
[src]-
impl Clone for lconv
[src]-
fn clone(&self) -> lconv
Returns a copy of the value. Read more
--
fn clone_from(&mut self, source: &Self)
1.0.0Performs copy-assignment from
+source
. Read moreTrait Implementations
+
impl Copy for lconv
[src]+
impl Clone for lconv
[src]diff --git a/libc/struct.linger.html b/libc/struct.linger.html index f4afaaa7..e4ae79da 100644 --- a/libc/struct.linger.html +++ b/libc/struct.linger.html @@ -53,12 +53,12 @@ pub l_linger: c_int, }+
fn clone(&self) -> lconv
Returns a copy of the value. Read more
++
fn clone_from(&mut self, source: &Self)
1.0.0Performs copy-assignment from
source
. Read moreFields
l_onoff: c_int
l_linger: c_int
-Trait Implementations
-
impl Copy for linger
[src]-
impl Clone for linger
[src]-
fn clone(&self) -> linger
Returns a copy of the value. Read more
--
fn clone_from(&mut self, source: &Self)
1.0.0Performs copy-assignment from
+source
. Read moreTrait Implementations
+
impl Copy for linger
[src]+
impl Clone for linger
[src]diff --git a/libc/struct.mcontext_t.html b/libc/struct.mcontext_t.html index 7451a3fb..dac066af 100644 --- a/libc/struct.mcontext_t.html +++ b/libc/struct.mcontext_t.html @@ -54,12 +54,12 @@ // some fields omitted }+
fn clone(&self) -> linger
Returns a copy of the value. Read more
++
fn clone_from(&mut self, source: &Self)
1.0.0Performs copy-assignment from
source
. Read moreFields
gregs: [greg_t; 23]
fpregs: *mut _libc_fpstate
-Trait Implementations
-
impl Copy for mcontext_t
[src]-
impl Clone for mcontext_t
[src]-
fn clone(&self) -> mcontext_t
Returns a copy of the value. Read more
--
fn clone_from(&mut self, source: &Self)
1.0.0Performs copy-assignment from
+source
. Read moreTrait Implementations
+
impl Copy for mcontext_t
[src]+
impl Clone for mcontext_t
[src]diff --git a/libc/struct.mq_attr.html b/libc/struct.mq_attr.html index cc28a8b6..175e69ac 100644 --- a/libc/struct.mq_attr.html +++ b/libc/struct.mq_attr.html @@ -58,12 +58,12 @@+
fn clone(&self) -> mcontext_t
Returns a copy of the value. Read more
++
fn clone_from(&mut self, source: &Self)
1.0.0Performs copy-assignment from
source
. Read moremq_maxmsg: c_long
mq_msgsize: c_long
mq_curmsgs: c_long
-Trait Implementations
-
impl Copy for mq_attr
[src]-
impl Clone for mq_attr
[src]-
fn clone(&self) -> mq_attr
Returns a copy of the value. Read more
--
fn clone_from(&mut self, source: &Self)
1.0.0Performs copy-assignment from
+source
. Read moreTrait Implementations
+
impl Copy for mq_attr
[src]+
impl Clone for mq_attr
[src]diff --git a/libc/struct.msghdr.html b/libc/struct.msghdr.html index 193f3876..0351f45a 100644 --- a/libc/struct.msghdr.html +++ b/libc/struct.msghdr.html @@ -63,12 +63,12 @@+
fn clone(&self) -> mq_attr
Returns a copy of the value. Read more
++
fn clone_from(&mut self, source: &Self)
1.0.0Performs copy-assignment from
source
. Read moremsg_control: *mut c_void
msg_controllen: size_t
msg_flags: c_int
-Trait Implementations
-
impl Copy for msghdr
[src]-
impl Clone for msghdr
[src]-
fn clone(&self) -> msghdr
Returns a copy of the value. Read more
--
fn clone_from(&mut self, source: &Self)
1.0.0Performs copy-assignment from
+source
. Read moreTrait Implementations
+
impl Copy for msghdr
[src]+
impl Clone for msghdr
[src]diff --git a/libc/struct.passwd.html b/libc/struct.passwd.html index 08fc4236..0ec6da0f 100644 --- a/libc/struct.passwd.html +++ b/libc/struct.passwd.html @@ -63,12 +63,12 @@+
fn clone(&self) -> msghdr
Returns a copy of the value. Read more
++
fn clone_from(&mut self, source: &Self)
1.0.0Performs copy-assignment from
source
. Read morepw_gecos: *mut c_char
pw_dir: *mut c_char
pw_shell: *mut c_char
-Trait Implementations
-
impl Copy for passwd
[src]-
impl Clone for passwd
[src]-
fn clone(&self) -> passwd
Returns a copy of the value. Read more
--
fn clone_from(&mut self, source: &Self)
1.0.0Performs copy-assignment from
+source
. Read moreTrait Implementations
+
impl Copy for passwd
[src]+
impl Clone for passwd
[src]diff --git a/libc/struct.pollfd.html b/libc/struct.pollfd.html index 33c4440d..32e37c0a 100644 --- a/libc/struct.pollfd.html +++ b/libc/struct.pollfd.html @@ -55,12 +55,12 @@ }+
fn clone(&self) -> passwd
Returns a copy of the value. Read more
++
fn clone_from(&mut self, source: &Self)
1.0.0Performs copy-assignment from
source
. Read moreFields
fd: c_int
events: c_short
revents: c_short
-Trait Implementations
-
impl Copy for pollfd
[src]-
impl Clone for pollfd
[src]-
fn clone(&self) -> pollfd
Returns a copy of the value. Read more
--
fn clone_from(&mut self, source: &Self)
1.0.0Performs copy-assignment from
+source
. Read moreTrait Implementations
+
impl Copy for pollfd
[src]+
impl Clone for pollfd
[src]diff --git a/libc/struct.pthread_attr_t.html b/libc/struct.pthread_attr_t.html index 1ba0ed4a..002d4109 100644 --- a/libc/struct.pthread_attr_t.html +++ b/libc/struct.pthread_attr_t.html @@ -50,12 +50,12 @@ [src]+
fn clone(&self) -> pollfd
Returns a copy of the value. Read more
++
fn clone_from(&mut self, source: &Self)
1.0.0Performs copy-assignment from
source
. Read morepub struct pthread_attr_t { // some fields omitted -}Trait Implementations
-
impl Copy for pthread_attr_t
[src]-
impl Clone for pthread_attr_t
[src]-
fn clone(&self) -> pthread_attr_t
Returns a copy of the value. Read more
--
fn clone_from(&mut self, source: &Self)
1.0.0Performs copy-assignment from
+}source
. Read moreTrait Implementations
+
impl Copy for pthread_attr_t
[src]+
impl Clone for pthread_attr_t
[src]diff --git a/libc/struct.pthread_cond_t.html b/libc/struct.pthread_cond_t.html index 197845c6..1e841ef7 100644 --- a/libc/struct.pthread_cond_t.html +++ b/libc/struct.pthread_cond_t.html @@ -50,12 +50,12 @@ [src]+
fn clone(&self) -> pthread_attr_t
Returns a copy of the value. Read more
++
fn clone_from(&mut self, source: &Self)
1.0.0Performs copy-assignment from
source
. Read morepub struct pthread_cond_t { // some fields omitted -}Trait Implementations
-
impl Copy for pthread_cond_t
[src]-
impl Clone for pthread_cond_t
[src]-
fn clone(&self) -> pthread_cond_t
Returns a copy of the value. Read more
--
fn clone_from(&mut self, source: &Self)
1.0.0Performs copy-assignment from
+}source
. Read moreTrait Implementations
+
impl Copy for pthread_cond_t
[src]+
impl Clone for pthread_cond_t
[src]diff --git a/libc/struct.pthread_condattr_t.html b/libc/struct.pthread_condattr_t.html index b31664f4..e24cb004 100644 --- a/libc/struct.pthread_condattr_t.html +++ b/libc/struct.pthread_condattr_t.html @@ -50,12 +50,12 @@ [src]+
fn clone(&self) -> pthread_cond_t
Returns a copy of the value. Read more
++
fn clone_from(&mut self, source: &Self)
1.0.0Performs copy-assignment from
source
. Read morepub struct pthread_condattr_t { // some fields omitted -}Trait Implementations
-
impl Copy for pthread_condattr_t
[src]-
impl Clone for pthread_condattr_t
[src]-
fn clone(&self) -> pthread_condattr_t
Returns a copy of the value. Read more
--
fn clone_from(&mut self, source: &Self)
1.0.0Performs copy-assignment from
+}source
. Read moreTrait Implementations
+
impl Copy for pthread_condattr_t
[src]+
impl Clone for pthread_condattr_t
[src]diff --git a/libc/struct.pthread_mutex_t.html b/libc/struct.pthread_mutex_t.html index 1155770e..3c4e8169 100644 --- a/libc/struct.pthread_mutex_t.html +++ b/libc/struct.pthread_mutex_t.html @@ -50,12 +50,12 @@ [src]+
fn clone(&self) -> pthread_condattr_t
Returns a copy of the value. Read more
++
fn clone_from(&mut self, source: &Self)
1.0.0Performs copy-assignment from
source
. Read morepub struct pthread_mutex_t { // some fields omitted -}Trait Implementations
-
impl Copy for pthread_mutex_t
[src]-
impl Clone for pthread_mutex_t
[src]-
fn clone(&self) -> pthread_mutex_t
Returns a copy of the value. Read more
--
fn clone_from(&mut self, source: &Self)
1.0.0Performs copy-assignment from
+}source
. Read moreTrait Implementations
+
impl Copy for pthread_mutex_t
[src]+
impl Clone for pthread_mutex_t
[src]diff --git a/libc/struct.pthread_mutexattr_t.html b/libc/struct.pthread_mutexattr_t.html index 78e5209b..0c10b998 100644 --- a/libc/struct.pthread_mutexattr_t.html +++ b/libc/struct.pthread_mutexattr_t.html @@ -50,12 +50,12 @@ [src]+
fn clone(&self) -> pthread_mutex_t
Returns a copy of the value. Read more
++
fn clone_from(&mut self, source: &Self)
1.0.0Performs copy-assignment from
source
. Read morepub struct pthread_mutexattr_t { // some fields omitted -}Trait Implementations
-
impl Copy for pthread_mutexattr_t
[src]-
impl Clone for pthread_mutexattr_t
[src]-
fn clone(&self) -> pthread_mutexattr_t
Returns a copy of the value. Read more
--
fn clone_from(&mut self, source: &Self)
1.0.0Performs copy-assignment from
+}source
. Read moreTrait Implementations
+
impl Copy for pthread_mutexattr_t
[src]+
impl Clone for pthread_mutexattr_t
[src]diff --git a/libc/struct.pthread_rwlock_t.html b/libc/struct.pthread_rwlock_t.html index ddb79a6a..5c6be6a7 100644 --- a/libc/struct.pthread_rwlock_t.html +++ b/libc/struct.pthread_rwlock_t.html @@ -50,12 +50,12 @@ [src]+
fn clone(&self) -> pthread_mutexattr_t
Returns a copy of the value. Read more
++
fn clone_from(&mut self, source: &Self)
1.0.0Performs copy-assignment from
source
. Read morepub struct pthread_rwlock_t { // some fields omitted -}Trait Implementations
-
impl Copy for pthread_rwlock_t
[src]-
impl Clone for pthread_rwlock_t
[src]-
fn clone(&self) -> pthread_rwlock_t
Returns a copy of the value. Read more
--
fn clone_from(&mut self, source: &Self)
1.0.0Performs copy-assignment from
+}source
. Read moreTrait Implementations
+
impl Copy for pthread_rwlock_t
[src]+
impl Clone for pthread_rwlock_t
[src]diff --git a/libc/struct.rlimit.html b/libc/struct.rlimit.html index 99e0b11d..2940e1ef 100644 --- a/libc/struct.rlimit.html +++ b/libc/struct.rlimit.html @@ -53,12 +53,12 @@ pub rlim_max: rlim_t, }+
fn clone(&self) -> pthread_rwlock_t
Returns a copy of the value. Read more
++
fn clone_from(&mut self, source: &Self)
1.0.0Performs copy-assignment from
source
. Read moreFields
rlim_cur: rlim_t
rlim_max: rlim_t
-Trait Implementations
-
impl Copy for rlimit
[src]-
impl Clone for rlimit
[src]-
fn clone(&self) -> rlimit
Returns a copy of the value. Read more
--
fn clone_from(&mut self, source: &Self)
1.0.0Performs copy-assignment from
+source
. Read moreTrait Implementations
+
impl Copy for rlimit
[src]+
impl Clone for rlimit
[src]diff --git a/libc/struct.rlimit64.html b/libc/struct.rlimit64.html index 204327f0..881fa9bc 100644 --- a/libc/struct.rlimit64.html +++ b/libc/struct.rlimit64.html @@ -53,12 +53,12 @@ pub rlim_max: rlim64_t, }+
fn clone(&self) -> rlimit
Returns a copy of the value. Read more
++
fn clone_from(&mut self, source: &Self)
1.0.0Performs copy-assignment from
source
. Read moreFields
rlim_cur: rlim64_t
rlim_max: rlim64_t
-Trait Implementations
-
impl Copy for rlimit64
[src]-
impl Clone for rlimit64
[src]-
fn clone(&self) -> rlimit64
Returns a copy of the value. Read more
--
fn clone_from(&mut self, source: &Self)
1.0.0Performs copy-assignment from
+source
. Read moreTrait Implementations
+
impl Copy for rlimit64
[src]+
impl Clone for rlimit64
[src]diff --git a/libc/struct.rusage.html b/libc/struct.rusage.html index 04caab0b..2c395125 100644 --- a/libc/struct.rusage.html +++ b/libc/struct.rusage.html @@ -81,12 +81,12 @@+
fn clone(&self) -> rlimit64
Returns a copy of the value. Read more
++
fn clone_from(&mut self, source: &Self)
1.0.0Performs copy-assignment from
source
. Read moreru_nsignals: c_long
ru_nvcsw: c_long
ru_nivcsw: c_long
-Trait Implementations
-
impl Copy for rusage
[src]-
impl Clone for rusage
[src]-
fn clone(&self) -> rusage
Returns a copy of the value. Read more
--
fn clone_from(&mut self, source: &Self)
1.0.0Performs copy-assignment from
+source
. Read moreTrait Implementations
+
impl Copy for rusage
[src]+
impl Clone for rusage
[src]diff --git a/libc/struct.sched_param.html b/libc/struct.sched_param.html index 22b7ba85..39796229 100644 --- a/libc/struct.sched_param.html +++ b/libc/struct.sched_param.html @@ -51,12 +51,12 @@+
fn clone(&self) -> rusage
Returns a copy of the value. Read more
++
fn clone_from(&mut self, source: &Self)
1.0.0Performs copy-assignment from
source
. Read morepub struct sched_param { pub sched_priority: c_int, }Fields
sched_priority: c_int
-Trait Implementations
-
impl Copy for sched_param
[src]-
impl Clone for sched_param
[src]-
fn clone(&self) -> sched_param
Returns a copy of the value. Read more
--
fn clone_from(&mut self, source: &Self)
1.0.0Performs copy-assignment from
+source
. Read moreTrait Implementations
+
impl Copy for sched_param
[src]+
impl Clone for sched_param
[src]diff --git a/libc/struct.sem_t.html b/libc/struct.sem_t.html index e95528dc..95f62fb4 100644 --- a/libc/struct.sem_t.html +++ b/libc/struct.sem_t.html @@ -50,12 +50,12 @@ [src]+
fn clone(&self) -> sched_param
Returns a copy of the value. Read more
++
fn clone_from(&mut self, source: &Self)
1.0.0Performs copy-assignment from
source
. Read morepub struct sem_t { // some fields omitted -}Trait Implementations
-
impl Copy for sem_t
[src]-
impl Clone for sem_t
[src]-
fn clone(&self) -> sem_t
Returns a copy of the value. Read more
--
fn clone_from(&mut self, source: &Self)
1.0.0Performs copy-assignment from
+}source
. Read moreTrait Implementations
+
impl Copy for sem_t
[src]+
impl Clone for sem_t
[src]diff --git a/libc/struct.shmid_ds.html b/libc/struct.shmid_ds.html index 0e71aa09..2962786c 100644 --- a/libc/struct.shmid_ds.html +++ b/libc/struct.shmid_ds.html @@ -66,12 +66,12 @@+
fn clone(&self) -> sem_t
Returns a copy of the value. Read more
++
fn clone_from(&mut self, source: &Self)
1.0.0Performs copy-assignment from
source
. Read moreshm_cpid: pid_t
shm_lpid: pid_t
shm_nattch: shmatt_t
-Trait Implementations
-
impl Copy for shmid_ds
[src]-
impl Clone for shmid_ds
[src]-
fn clone(&self) -> shmid_ds
Returns a copy of the value. Read more
--
fn clone_from(&mut self, source: &Self)
1.0.0Performs copy-assignment from
+source
. Read moreTrait Implementations
+
impl Copy for shmid_ds
[src]+
impl Clone for shmid_ds
[src]diff --git a/libc/struct.sigaction.html b/libc/struct.sigaction.html index 3a93153d..953a6acb 100644 --- a/libc/struct.sigaction.html +++ b/libc/struct.sigaction.html @@ -56,12 +56,12 @@ }+
fn clone(&self) -> shmid_ds
Returns a copy of the value. Read more
++
fn clone_from(&mut self, source: &Self)
1.0.0Performs copy-assignment from
source
. Read moreFields
sa_sigaction: sighandler_t
sa_mask: sigset_t
sa_flags: c_int
-Trait Implementations
-
impl Copy for sigaction
[src]-
impl Clone for sigaction
[src]-
fn clone(&self) -> sigaction
Returns a copy of the value. Read more
--
fn clone_from(&mut self, source: &Self)
1.0.0Performs copy-assignment from
+source
. Read moreTrait Implementations
+
impl Copy for sigaction
[src]+
impl Clone for sigaction
[src]diff --git a/libc/struct.siginfo_t.html b/libc/struct.siginfo_t.html index c0473c57..19e7ced0 100644 --- a/libc/struct.siginfo_t.html +++ b/libc/struct.siginfo_t.html @@ -58,12 +58,12 @@+
fn clone(&self) -> sigaction
Returns a copy of the value. Read more
++
fn clone_from(&mut self, source: &Self)
1.0.0Performs copy-assignment from
source
. Read moresi_errno: c_int
si_code: c_int
_pad: [c_int; 29]
-Trait Implementations
-
impl Copy for siginfo_t
[src]-
impl Clone for siginfo_t
[src]-
fn clone(&self) -> siginfo_t
Returns a copy of the value. Read more
--
fn clone_from(&mut self, source: &Self)
1.0.0Performs copy-assignment from
+source
. Read moreTrait Implementations
+
impl Copy for siginfo_t
[src]+
impl Clone for siginfo_t
[src]diff --git a/libc/struct.signalfd_siginfo.html b/libc/struct.signalfd_siginfo.html index 879242f0..39a07211 100644 --- a/libc/struct.signalfd_siginfo.html +++ b/libc/struct.signalfd_siginfo.html @@ -82,12 +82,12 @@+
fn clone(&self) -> siginfo_t
Returns a copy of the value. Read more
++
fn clone_from(&mut self, source: &Self)
1.0.0Performs copy-assignment from
source
. Read moressi_utime: uint64_t
ssi_stime: uint64_t
ssi_addr: uint64_t
-Trait Implementations
-
impl Copy for signalfd_siginfo
[src]-
impl Clone for signalfd_siginfo
[src]-
fn clone(&self) -> signalfd_siginfo
Returns a copy of the value. Read more
--
fn clone_from(&mut self, source: &Self)
1.0.0Performs copy-assignment from
+source
. Read moreTrait Implementations
+
impl Copy for signalfd_siginfo
[src]+
impl Clone for signalfd_siginfo
[src]diff --git a/libc/struct.sigset_t.html b/libc/struct.sigset_t.html index 2bf5f87a..273a3125 100644 --- a/libc/struct.sigset_t.html +++ b/libc/struct.sigset_t.html @@ -50,12 +50,12 @@ [src]+
fn clone(&self) -> signalfd_siginfo
Returns a copy of the value. Read more
++
fn clone_from(&mut self, source: &Self)
1.0.0Performs copy-assignment from
source
. Read morepub struct sigset_t { // some fields omitted -}Trait Implementations
-
impl Copy for sigset_t
[src]-
impl Clone for sigset_t
[src]-
fn clone(&self) -> sigset_t
Returns a copy of the value. Read more
--
fn clone_from(&mut self, source: &Self)
1.0.0Performs copy-assignment from
+}source
. Read moreTrait Implementations
+
impl Copy for sigset_t
[src]+
impl Clone for sigset_t
[src]diff --git a/libc/struct.sockaddr.html b/libc/struct.sockaddr.html index b60a781b..0b8ab1c5 100644 --- a/libc/struct.sockaddr.html +++ b/libc/struct.sockaddr.html @@ -53,12 +53,12 @@ pub sa_data: [c_char; 14], }+
fn clone(&self) -> sigset_t
Returns a copy of the value. Read more
++
fn clone_from(&mut self, source: &Self)
1.0.0Performs copy-assignment from
source
. Read moreFields
sa_family: sa_family_t
sa_data: [c_char; 14]
-Trait Implementations
-
impl Copy for sockaddr
[src]-
impl Clone for sockaddr
[src]-
fn clone(&self) -> sockaddr
Returns a copy of the value. Read more
--
fn clone_from(&mut self, source: &Self)
1.0.0Performs copy-assignment from
+source
. Read moreTrait Implementations
+
impl Copy for sockaddr
[src]+
impl Clone for sockaddr
[src]diff --git a/libc/struct.sockaddr_in.html b/libc/struct.sockaddr_in.html index 8da6f695..4259539d 100644 --- a/libc/struct.sockaddr_in.html +++ b/libc/struct.sockaddr_in.html @@ -57,12 +57,12 @@+
fn clone(&self) -> sockaddr
Returns a copy of the value. Read more
++
fn clone_from(&mut self, source: &Self)
1.0.0Performs copy-assignment from
source
. Read moresin_port: in_port_t
sin_addr: in_addr
sin_zero: [u8; 8]
-Trait Implementations
-
impl Copy for sockaddr_in
[src]-
impl Clone for sockaddr_in
[src]-
fn clone(&self) -> sockaddr_in
Returns a copy of the value. Read more
--
fn clone_from(&mut self, source: &Self)
1.0.0Performs copy-assignment from
+source
. Read moreTrait Implementations
+
impl Copy for sockaddr_in
[src]+
impl Clone for sockaddr_in
[src]diff --git a/libc/struct.sockaddr_in6.html b/libc/struct.sockaddr_in6.html index d1f07674..3dd945cf 100644 --- a/libc/struct.sockaddr_in6.html +++ b/libc/struct.sockaddr_in6.html @@ -59,12 +59,12 @@+
fn clone(&self) -> sockaddr_in
Returns a copy of the value. Read more
++
fn clone_from(&mut self, source: &Self)
1.0.0Performs copy-assignment from
source
. Read moresin6_flowinfo: u32
sin6_addr: in6_addr
sin6_scope_id: u32
-Trait Implementations
-
impl Copy for sockaddr_in6
[src]-
impl Clone for sockaddr_in6
[src]-
fn clone(&self) -> sockaddr_in6
Returns a copy of the value. Read more
--
fn clone_from(&mut self, source: &Self)
1.0.0Performs copy-assignment from
+source
. Read moreTrait Implementations
+
impl Copy for sockaddr_in6
[src]+
impl Clone for sockaddr_in6
[src]diff --git a/libc/struct.sockaddr_ll.html b/libc/struct.sockaddr_ll.html index fe2f9e2e..267e4da3 100644 --- a/libc/struct.sockaddr_ll.html +++ b/libc/struct.sockaddr_ll.html @@ -63,12 +63,12 @@+
fn clone(&self) -> sockaddr_in6
Returns a copy of the value. Read more
++
fn clone_from(&mut self, source: &Self)
1.0.0Performs copy-assignment from
source
. Read moresll_pkttype: c_uchar
sll_halen: c_uchar
sll_addr: [c_uchar; 8]
-Trait Implementations
-
impl Copy for sockaddr_ll
[src]-
impl Clone for sockaddr_ll
[src]-
fn clone(&self) -> sockaddr_ll
Returns a copy of the value. Read more
--
fn clone_from(&mut self, source: &Self)
1.0.0Performs copy-assignment from
+source
. Read moreTrait Implementations
+
impl Copy for sockaddr_ll
[src]+
impl Clone for sockaddr_ll
[src]diff --git a/libc/struct.sockaddr_nl.html b/libc/struct.sockaddr_nl.html index 01444436..cf7f4b30 100644 --- a/libc/struct.sockaddr_nl.html +++ b/libc/struct.sockaddr_nl.html @@ -56,12 +56,12 @@ }+
fn clone(&self) -> sockaddr_ll
Returns a copy of the value. Read more
++
fn clone_from(&mut self, source: &Self)
1.0.0Performs copy-assignment from
source
. Read moreFields
nl_family: sa_family_t
nl_pid: u32
nl_groups: u32
-Trait Implementations
-
impl Copy for sockaddr_nl
[src]-
impl Clone for sockaddr_nl
[src]-
fn clone(&self) -> sockaddr_nl
Returns a copy of the value. Read more
--
fn clone_from(&mut self, source: &Self)
1.0.0Performs copy-assignment from
+source
. Read moreTrait Implementations
+
impl Copy for sockaddr_nl
[src]+
impl Clone for sockaddr_nl
[src]diff --git a/libc/struct.sockaddr_storage.html b/libc/struct.sockaddr_storage.html index bd6f0a9f..f257f397 100644 --- a/libc/struct.sockaddr_storage.html +++ b/libc/struct.sockaddr_storage.html @@ -52,12 +52,12 @@ pub ss_family: sa_family_t, // some fields omitted }+
fn clone(&self) -> sockaddr_nl
Returns a copy of the value. Read more
++
fn clone_from(&mut self, source: &Self)
1.0.0Performs copy-assignment from
source
. Read moreFields
ss_family: sa_family_t
-Trait Implementations
-
impl Copy for sockaddr_storage
[src]-
impl Clone for sockaddr_storage
[src]-
fn clone(&self) -> sockaddr_storage
Returns a copy of the value. Read more
--
fn clone_from(&mut self, source: &Self)
1.0.0