fix(rustup): rustc (be9bd7c93 2015-04-05)

* using std::convert
* update to latest hyper (and other dependencies)

Related to #46
This commit is contained in:
Sebastian Thiel
2015-04-07 11:53:47 +02:00
parent 919ae4d8ae
commit 91861dcb71
354 changed files with 62261 additions and 24815 deletions

View File

@@ -70,8 +70,8 @@ google-datastore1_beta2 = "*"
```Rust
extern crate hyper;
extern crate "yup-oauth2" as oauth2;
extern crate "google-datastore1_beta2" as datastore1_beta2;
extern crate yup_oauth2 as oauth2;
extern crate google_datastore1_beta2 as datastore1_beta2;
use datastore1_beta2::LookupRequest;
use datastore1_beta2::{Result, Error};
use std::default::Default;

View File

@@ -1,11 +1,10 @@
// COPY OF 'src/rust/api/cmn.rs'
// DO NOT EDIT
use std::marker::MarkerTrait;
use std::io::{self, Read, Seek, Cursor, Write, SeekFrom};
use std;
use std::fmt::{self, Display};
use std::str::FromStr;
use std::thread::sleep;
use std::thread::sleep_ms;
use mime::{Mime, TopLevel, SubLevel, Attr, Value};
use oauth2::{TokenType, Retry, self};
@@ -21,35 +20,35 @@ use serde;
/// Identifies the Hub. There is only one per library, this trait is supposed
/// to make intended use more explicit.
/// The hub allows to access all resource methods more easily.
pub trait Hub: MarkerTrait {}
pub trait Hub {}
/// Identifies types for building methods of a particular resource type
pub trait MethodsBuilder: MarkerTrait {}
pub trait MethodsBuilder {}
/// Identifies types which represent builders for a particular resource method
pub trait CallBuilder: MarkerTrait {}
pub trait CallBuilder {}
/// Identifies types which can be inserted and deleted.
/// Types with this trait are most commonly used by clients of this API.
pub trait Resource: MarkerTrait {}
pub trait Resource {}
/// Identifies types which are used in API responses.
pub trait ResponseResult: MarkerTrait {}
pub trait ResponseResult {}
/// Identifies types which are used in API requests.
pub trait RequestValue: MarkerTrait {}
pub trait RequestValue {}
/// Identifies types which are not actually used by the API
/// This might be a bug within the google API schema.
pub trait UnusedType: MarkerTrait {}
pub trait UnusedType {}
/// Identifies types which are only used as part of other types, which
/// usually are carrying the `Resource` trait.
pub trait Part: MarkerTrait {}
pub trait Part {}
/// Identifies types which are only used by other types internally.
/// They have no special meaning, this trait just marks them for completeness.
pub trait NestedType: MarkerTrait {}
pub trait NestedType {}
/// A utility to specify reader types which provide seeking capabilities too
pub trait ReadSeek: Seek + Read {}
@@ -380,14 +379,10 @@ impl<'a> Read for MultiPartReader<'a> {
}
}
/// The `X-Upload-Content-Type` header.
#[derive(Clone, PartialEq, Debug)]
pub struct XUploadContentType(pub Mime);
impl_header!(XUploadContentType,
"X-Upload-Content-Type",
Mime);
header!{
#[doc="The `X-Upload-Content-Type` header."]
(XUploadContentType, "X-Upload-Content-Type") => [Mime]
}
#[derive(Clone, PartialEq, Debug)]
pub struct Chunk {
@@ -519,7 +514,7 @@ impl<'a, NC, A> ResumableUploadHelper<'a, NC, A>
Some(hh) if r.status == StatusCode::PermanentRedirect => hh,
None|Some(_) => {
if let Retry::After(d) = self.delegate.http_failure(&r, None) {
sleep(d);
sleep_ms(d.num_milliseconds() as u32);
continue;
}
return Err(Ok(r))
@@ -529,7 +524,7 @@ impl<'a, NC, A> ResumableUploadHelper<'a, NC, A>
}
Err(err) => {
if let Retry::After(d) = self.delegate.http_error(&err) {
sleep(d);
sleep_ms(d.num_milliseconds() as u32);
continue;
}
return Err(Err(err))
@@ -586,7 +581,7 @@ impl<'a, NC, A> ResumableUploadHelper<'a, NC, A>
let mut json_err = String::new();
res.read_to_string(&mut json_err).unwrap();
if let Retry::After(d) = self.delegate.http_failure(&res, serde::json::from_str(&json_err).ok()) {
sleep(d);
sleep_ms(d.num_milliseconds() as u32);
continue;
}
}
@@ -594,7 +589,7 @@ impl<'a, NC, A> ResumableUploadHelper<'a, NC, A>
},
Err(err) => {
if let Retry::After(d) = self.delegate.http_error(&err) {
sleep(d);
sleep_ms(d.num_milliseconds() as u32);
continue;
}
return Some(Err(err))

View File

@@ -70,8 +70,8 @@
//!
//! ```test_harness,no_run
//! extern crate hyper;
//! extern crate "yup-oauth2" as oauth2;
//! extern crate "google-datastore1_beta2" as datastore1_beta2;
//! extern crate yup_oauth2 as oauth2;
//! extern crate google_datastore1_beta2 as datastore1_beta2;
//! use datastore1_beta2::LookupRequest;
//! use datastore1_beta2::{Result, Error};
//! # #[test] fn egal() {
@@ -170,20 +170,20 @@
//! [google-go-api]: https://github.com/google/google-api-go-client
//!
//!
#![feature(core,io,thread_sleep)]
#![feature(std_misc)]
// Unused attributes happen thanks to defined, but unused structures
// We don't warn about this, as depending on the API, some data structures or facilities are never used.
// Instead of pre-determining this, we just disable the lint. It's manually tuned to not have any
// unused imports in fully featured APIs. Same with unused_mut ... .
#![allow(unused_imports, unused_mut, dead_code)]
// Required for serde annotations
#![feature(custom_derive, custom_attribute, plugin)]
#![feature(custom_derive, custom_attribute, plugin, slice_patterns)]
#![plugin(serde_macros)]
#[macro_use]
extern crate hyper;
extern crate serde;
extern crate "yup-oauth2" as oauth2;
extern crate yup_oauth2 as oauth2;
extern crate mime;
extern crate url;
@@ -198,7 +198,7 @@ use std::marker::PhantomData;
use serde::json;
use std::io;
use std::fs;
use std::thread::sleep;
use std::thread::sleep_ms;
pub use cmn::{MultiPartReader, ToParts, MethodInfo, Result, Error, CallBuilder, Hub, ReadSeek, Part, ResponseResult, RequestValue, NestedType, Delegate, DefaultDelegate, MethodsBuilder, Resource, JsonServerError};
@@ -222,8 +222,8 @@ pub enum Scope {
CloudPlatform,
}
impl Str for Scope {
fn as_slice(&self) -> &str {
impl AsRef<str> for Scope {
fn as_ref(&self) -> &str {
match *self {
Scope::UserinfoEmail => "https://www.googleapis.com/auth/userinfo.email",
Scope::Full => "https://www.googleapis.com/auth/datastore",
@@ -252,8 +252,8 @@ impl Default for Scope {
///
/// ```test_harness,no_run
/// extern crate hyper;
/// extern crate "yup-oauth2" as oauth2;
/// extern crate "google-datastore1_beta2" as datastore1_beta2;
/// extern crate yup_oauth2 as oauth2;
/// extern crate google_datastore1_beta2 as datastore1_beta2;
/// use datastore1_beta2::LookupRequest;
/// use datastore1_beta2::{Result, Error};
/// # #[test] fn egal() {
@@ -1056,8 +1056,8 @@ impl Part for Query {}
///
/// ```test_harness,no_run
/// extern crate hyper;
/// extern crate "yup-oauth2" as oauth2;
/// extern crate "google-datastore1_beta2" as datastore1_beta2;
/// extern crate yup_oauth2 as oauth2;
/// extern crate google_datastore1_beta2 as datastore1_beta2;
///
/// # #[test] fn egal() {
/// use std::default::Default;
@@ -1219,8 +1219,8 @@ impl<'a, C, NC, A> DatasetMethods<'a, C, NC, A> {
///
/// ```test_harness,no_run
/// # extern crate hyper;
/// # extern crate "yup-oauth2" as oauth2;
/// # extern crate "google-datastore1_beta2" as datastore1_beta2;
/// # extern crate yup_oauth2 as oauth2;
/// # extern crate google_datastore1_beta2 as datastore1_beta2;
/// use datastore1_beta2::CommitRequest;
/// # #[test] fn egal() {
/// # use std::default::Default;
@@ -1287,7 +1287,7 @@ impl<'a, C, NC, A> DatasetCommitCall<'a, C, NC, A> where NC: hyper::net::Network
let mut url = "https://www.googleapis.com/datastore/v1beta2/datasets/{datasetId}/commit".to_string();
if self._scopes.len() == 0 {
self._scopes.insert(Scope::CloudPlatform.as_slice().to_string(), ());
self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ());
}
for &(find_this, param_name) in [("{datasetId}", "datasetId")].iter() {
@@ -1317,7 +1317,7 @@ impl<'a, C, NC, A> DatasetCommitCall<'a, C, NC, A> where NC: hyper::net::Network
if params.len() > 0 {
url.push('?');
url.push_str(&url::form_urlencoded::serialize(params.iter().map(|t| (t.0, t.1.as_slice()))));
url.push_str(&url::form_urlencoded::serialize(params.iter().map(|t| (t.0, t.1.as_ref()))));
}
let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default());
@@ -1340,7 +1340,7 @@ impl<'a, C, NC, A> DatasetCommitCall<'a, C, NC, A> where NC: hyper::net::Network
request_value_reader.seek(io::SeekFrom::Start(0)).unwrap();
let mut req_result = {
let mut client = &mut *self.hub.client.borrow_mut();
let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.as_slice())
let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.as_ref())
.header(UserAgent(self.hub._user_agent.clone()))
.header(auth_header.clone())
.header(ContentType(json_mime_type.clone()))
@@ -1354,7 +1354,7 @@ impl<'a, C, NC, A> DatasetCommitCall<'a, C, NC, A> where NC: hyper::net::Network
match req_result {
Err(err) => {
if let oauth2::Retry::After(d) = dlg.http_error(&err) {
sleep(d);
sleep_ms(d.num_milliseconds() as u32);
continue;
}
dlg.finished(false);
@@ -1365,7 +1365,7 @@ impl<'a, C, NC, A> DatasetCommitCall<'a, C, NC, A> where NC: hyper::net::Network
let mut json_err = String::new();
res.read_to_string(&mut json_err).unwrap();
if let oauth2::Retry::After(d) = dlg.http_failure(&res, json::from_str(&json_err).ok()) {
sleep(d);
sleep_ms(d.num_milliseconds() as u32);
continue;
}
dlg.finished(false);
@@ -1439,8 +1439,8 @@ impl<'a, C, NC, A> DatasetCommitCall<'a, C, NC, A> where NC: hyper::net::Network
/// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
/// * *alt* (query-string) - Data format for the response.
pub fn param<T>(mut self, name: T, value: T) -> DatasetCommitCall<'a, C, NC, A>
where T: Str {
self._additional_params.insert(name.as_slice().to_string(), value.as_slice().to_string());
where T: AsRef<str> {
self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string());
self
}
@@ -1456,8 +1456,8 @@ impl<'a, C, NC, A> DatasetCommitCall<'a, C, NC, A> where NC: hyper::net::Network
/// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
/// sufficient, a read-write scope will do as well.
pub fn add_scope<T>(mut self, scope: T) -> DatasetCommitCall<'a, C, NC, A>
where T: Str {
self._scopes.insert(scope.as_slice().to_string(), ());
where T: AsRef<str> {
self._scopes.insert(scope.as_ref().to_string(), ());
self
}
}
@@ -1474,8 +1474,8 @@ impl<'a, C, NC, A> DatasetCommitCall<'a, C, NC, A> where NC: hyper::net::Network
///
/// ```test_harness,no_run
/// # extern crate hyper;
/// # extern crate "yup-oauth2" as oauth2;
/// # extern crate "google-datastore1_beta2" as datastore1_beta2;
/// # extern crate yup_oauth2 as oauth2;
/// # extern crate google_datastore1_beta2 as datastore1_beta2;
/// use datastore1_beta2::AllocateIdsRequest;
/// # #[test] fn egal() {
/// # use std::default::Default;
@@ -1542,7 +1542,7 @@ impl<'a, C, NC, A> DatasetAllocateIdCall<'a, C, NC, A> where NC: hyper::net::Net
let mut url = "https://www.googleapis.com/datastore/v1beta2/datasets/{datasetId}/allocateIds".to_string();
if self._scopes.len() == 0 {
self._scopes.insert(Scope::CloudPlatform.as_slice().to_string(), ());
self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ());
}
for &(find_this, param_name) in [("{datasetId}", "datasetId")].iter() {
@@ -1572,7 +1572,7 @@ impl<'a, C, NC, A> DatasetAllocateIdCall<'a, C, NC, A> where NC: hyper::net::Net
if params.len() > 0 {
url.push('?');
url.push_str(&url::form_urlencoded::serialize(params.iter().map(|t| (t.0, t.1.as_slice()))));
url.push_str(&url::form_urlencoded::serialize(params.iter().map(|t| (t.0, t.1.as_ref()))));
}
let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default());
@@ -1595,7 +1595,7 @@ impl<'a, C, NC, A> DatasetAllocateIdCall<'a, C, NC, A> where NC: hyper::net::Net
request_value_reader.seek(io::SeekFrom::Start(0)).unwrap();
let mut req_result = {
let mut client = &mut *self.hub.client.borrow_mut();
let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.as_slice())
let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.as_ref())
.header(UserAgent(self.hub._user_agent.clone()))
.header(auth_header.clone())
.header(ContentType(json_mime_type.clone()))
@@ -1609,7 +1609,7 @@ impl<'a, C, NC, A> DatasetAllocateIdCall<'a, C, NC, A> where NC: hyper::net::Net
match req_result {
Err(err) => {
if let oauth2::Retry::After(d) = dlg.http_error(&err) {
sleep(d);
sleep_ms(d.num_milliseconds() as u32);
continue;
}
dlg.finished(false);
@@ -1620,7 +1620,7 @@ impl<'a, C, NC, A> DatasetAllocateIdCall<'a, C, NC, A> where NC: hyper::net::Net
let mut json_err = String::new();
res.read_to_string(&mut json_err).unwrap();
if let oauth2::Retry::After(d) = dlg.http_failure(&res, json::from_str(&json_err).ok()) {
sleep(d);
sleep_ms(d.num_milliseconds() as u32);
continue;
}
dlg.finished(false);
@@ -1694,8 +1694,8 @@ impl<'a, C, NC, A> DatasetAllocateIdCall<'a, C, NC, A> where NC: hyper::net::Net
/// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
/// * *alt* (query-string) - Data format for the response.
pub fn param<T>(mut self, name: T, value: T) -> DatasetAllocateIdCall<'a, C, NC, A>
where T: Str {
self._additional_params.insert(name.as_slice().to_string(), value.as_slice().to_string());
where T: AsRef<str> {
self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string());
self
}
@@ -1711,8 +1711,8 @@ impl<'a, C, NC, A> DatasetAllocateIdCall<'a, C, NC, A> where NC: hyper::net::Net
/// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
/// sufficient, a read-write scope will do as well.
pub fn add_scope<T>(mut self, scope: T) -> DatasetAllocateIdCall<'a, C, NC, A>
where T: Str {
self._scopes.insert(scope.as_slice().to_string(), ());
where T: AsRef<str> {
self._scopes.insert(scope.as_ref().to_string(), ());
self
}
}
@@ -1729,8 +1729,8 @@ impl<'a, C, NC, A> DatasetAllocateIdCall<'a, C, NC, A> where NC: hyper::net::Net
///
/// ```test_harness,no_run
/// # extern crate hyper;
/// # extern crate "yup-oauth2" as oauth2;
/// # extern crate "google-datastore1_beta2" as datastore1_beta2;
/// # extern crate yup_oauth2 as oauth2;
/// # extern crate google_datastore1_beta2 as datastore1_beta2;
/// use datastore1_beta2::RollbackRequest;
/// # #[test] fn egal() {
/// # use std::default::Default;
@@ -1797,7 +1797,7 @@ impl<'a, C, NC, A> DatasetRollbackCall<'a, C, NC, A> where NC: hyper::net::Netwo
let mut url = "https://www.googleapis.com/datastore/v1beta2/datasets/{datasetId}/rollback".to_string();
if self._scopes.len() == 0 {
self._scopes.insert(Scope::CloudPlatform.as_slice().to_string(), ());
self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ());
}
for &(find_this, param_name) in [("{datasetId}", "datasetId")].iter() {
@@ -1827,7 +1827,7 @@ impl<'a, C, NC, A> DatasetRollbackCall<'a, C, NC, A> where NC: hyper::net::Netwo
if params.len() > 0 {
url.push('?');
url.push_str(&url::form_urlencoded::serialize(params.iter().map(|t| (t.0, t.1.as_slice()))));
url.push_str(&url::form_urlencoded::serialize(params.iter().map(|t| (t.0, t.1.as_ref()))));
}
let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default());
@@ -1850,7 +1850,7 @@ impl<'a, C, NC, A> DatasetRollbackCall<'a, C, NC, A> where NC: hyper::net::Netwo
request_value_reader.seek(io::SeekFrom::Start(0)).unwrap();
let mut req_result = {
let mut client = &mut *self.hub.client.borrow_mut();
let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.as_slice())
let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.as_ref())
.header(UserAgent(self.hub._user_agent.clone()))
.header(auth_header.clone())
.header(ContentType(json_mime_type.clone()))
@@ -1864,7 +1864,7 @@ impl<'a, C, NC, A> DatasetRollbackCall<'a, C, NC, A> where NC: hyper::net::Netwo
match req_result {
Err(err) => {
if let oauth2::Retry::After(d) = dlg.http_error(&err) {
sleep(d);
sleep_ms(d.num_milliseconds() as u32);
continue;
}
dlg.finished(false);
@@ -1875,7 +1875,7 @@ impl<'a, C, NC, A> DatasetRollbackCall<'a, C, NC, A> where NC: hyper::net::Netwo
let mut json_err = String::new();
res.read_to_string(&mut json_err).unwrap();
if let oauth2::Retry::After(d) = dlg.http_failure(&res, json::from_str(&json_err).ok()) {
sleep(d);
sleep_ms(d.num_milliseconds() as u32);
continue;
}
dlg.finished(false);
@@ -1949,8 +1949,8 @@ impl<'a, C, NC, A> DatasetRollbackCall<'a, C, NC, A> where NC: hyper::net::Netwo
/// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
/// * *alt* (query-string) - Data format for the response.
pub fn param<T>(mut self, name: T, value: T) -> DatasetRollbackCall<'a, C, NC, A>
where T: Str {
self._additional_params.insert(name.as_slice().to_string(), value.as_slice().to_string());
where T: AsRef<str> {
self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string());
self
}
@@ -1966,8 +1966,8 @@ impl<'a, C, NC, A> DatasetRollbackCall<'a, C, NC, A> where NC: hyper::net::Netwo
/// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
/// sufficient, a read-write scope will do as well.
pub fn add_scope<T>(mut self, scope: T) -> DatasetRollbackCall<'a, C, NC, A>
where T: Str {
self._scopes.insert(scope.as_slice().to_string(), ());
where T: AsRef<str> {
self._scopes.insert(scope.as_ref().to_string(), ());
self
}
}
@@ -1984,8 +1984,8 @@ impl<'a, C, NC, A> DatasetRollbackCall<'a, C, NC, A> where NC: hyper::net::Netwo
///
/// ```test_harness,no_run
/// # extern crate hyper;
/// # extern crate "yup-oauth2" as oauth2;
/// # extern crate "google-datastore1_beta2" as datastore1_beta2;
/// # extern crate yup_oauth2 as oauth2;
/// # extern crate google_datastore1_beta2 as datastore1_beta2;
/// use datastore1_beta2::LookupRequest;
/// # #[test] fn egal() {
/// # use std::default::Default;
@@ -2052,7 +2052,7 @@ impl<'a, C, NC, A> DatasetLookupCall<'a, C, NC, A> where NC: hyper::net::Network
let mut url = "https://www.googleapis.com/datastore/v1beta2/datasets/{datasetId}/lookup".to_string();
if self._scopes.len() == 0 {
self._scopes.insert(Scope::CloudPlatform.as_slice().to_string(), ());
self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ());
}
for &(find_this, param_name) in [("{datasetId}", "datasetId")].iter() {
@@ -2082,7 +2082,7 @@ impl<'a, C, NC, A> DatasetLookupCall<'a, C, NC, A> where NC: hyper::net::Network
if params.len() > 0 {
url.push('?');
url.push_str(&url::form_urlencoded::serialize(params.iter().map(|t| (t.0, t.1.as_slice()))));
url.push_str(&url::form_urlencoded::serialize(params.iter().map(|t| (t.0, t.1.as_ref()))));
}
let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default());
@@ -2105,7 +2105,7 @@ impl<'a, C, NC, A> DatasetLookupCall<'a, C, NC, A> where NC: hyper::net::Network
request_value_reader.seek(io::SeekFrom::Start(0)).unwrap();
let mut req_result = {
let mut client = &mut *self.hub.client.borrow_mut();
let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.as_slice())
let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.as_ref())
.header(UserAgent(self.hub._user_agent.clone()))
.header(auth_header.clone())
.header(ContentType(json_mime_type.clone()))
@@ -2119,7 +2119,7 @@ impl<'a, C, NC, A> DatasetLookupCall<'a, C, NC, A> where NC: hyper::net::Network
match req_result {
Err(err) => {
if let oauth2::Retry::After(d) = dlg.http_error(&err) {
sleep(d);
sleep_ms(d.num_milliseconds() as u32);
continue;
}
dlg.finished(false);
@@ -2130,7 +2130,7 @@ impl<'a, C, NC, A> DatasetLookupCall<'a, C, NC, A> where NC: hyper::net::Network
let mut json_err = String::new();
res.read_to_string(&mut json_err).unwrap();
if let oauth2::Retry::After(d) = dlg.http_failure(&res, json::from_str(&json_err).ok()) {
sleep(d);
sleep_ms(d.num_milliseconds() as u32);
continue;
}
dlg.finished(false);
@@ -2204,8 +2204,8 @@ impl<'a, C, NC, A> DatasetLookupCall<'a, C, NC, A> where NC: hyper::net::Network
/// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
/// * *alt* (query-string) - Data format for the response.
pub fn param<T>(mut self, name: T, value: T) -> DatasetLookupCall<'a, C, NC, A>
where T: Str {
self._additional_params.insert(name.as_slice().to_string(), value.as_slice().to_string());
where T: AsRef<str> {
self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string());
self
}
@@ -2221,8 +2221,8 @@ impl<'a, C, NC, A> DatasetLookupCall<'a, C, NC, A> where NC: hyper::net::Network
/// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
/// sufficient, a read-write scope will do as well.
pub fn add_scope<T>(mut self, scope: T) -> DatasetLookupCall<'a, C, NC, A>
where T: Str {
self._scopes.insert(scope.as_slice().to_string(), ());
where T: AsRef<str> {
self._scopes.insert(scope.as_ref().to_string(), ());
self
}
}
@@ -2239,8 +2239,8 @@ impl<'a, C, NC, A> DatasetLookupCall<'a, C, NC, A> where NC: hyper::net::Network
///
/// ```test_harness,no_run
/// # extern crate hyper;
/// # extern crate "yup-oauth2" as oauth2;
/// # extern crate "google-datastore1_beta2" as datastore1_beta2;
/// # extern crate yup_oauth2 as oauth2;
/// # extern crate google_datastore1_beta2 as datastore1_beta2;
/// use datastore1_beta2::RunQueryRequest;
/// # #[test] fn egal() {
/// # use std::default::Default;
@@ -2307,7 +2307,7 @@ impl<'a, C, NC, A> DatasetRunQueryCall<'a, C, NC, A> where NC: hyper::net::Netwo
let mut url = "https://www.googleapis.com/datastore/v1beta2/datasets/{datasetId}/runQuery".to_string();
if self._scopes.len() == 0 {
self._scopes.insert(Scope::CloudPlatform.as_slice().to_string(), ());
self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ());
}
for &(find_this, param_name) in [("{datasetId}", "datasetId")].iter() {
@@ -2337,7 +2337,7 @@ impl<'a, C, NC, A> DatasetRunQueryCall<'a, C, NC, A> where NC: hyper::net::Netwo
if params.len() > 0 {
url.push('?');
url.push_str(&url::form_urlencoded::serialize(params.iter().map(|t| (t.0, t.1.as_slice()))));
url.push_str(&url::form_urlencoded::serialize(params.iter().map(|t| (t.0, t.1.as_ref()))));
}
let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default());
@@ -2360,7 +2360,7 @@ impl<'a, C, NC, A> DatasetRunQueryCall<'a, C, NC, A> where NC: hyper::net::Netwo
request_value_reader.seek(io::SeekFrom::Start(0)).unwrap();
let mut req_result = {
let mut client = &mut *self.hub.client.borrow_mut();
let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.as_slice())
let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.as_ref())
.header(UserAgent(self.hub._user_agent.clone()))
.header(auth_header.clone())
.header(ContentType(json_mime_type.clone()))
@@ -2374,7 +2374,7 @@ impl<'a, C, NC, A> DatasetRunQueryCall<'a, C, NC, A> where NC: hyper::net::Netwo
match req_result {
Err(err) => {
if let oauth2::Retry::After(d) = dlg.http_error(&err) {
sleep(d);
sleep_ms(d.num_milliseconds() as u32);
continue;
}
dlg.finished(false);
@@ -2385,7 +2385,7 @@ impl<'a, C, NC, A> DatasetRunQueryCall<'a, C, NC, A> where NC: hyper::net::Netwo
let mut json_err = String::new();
res.read_to_string(&mut json_err).unwrap();
if let oauth2::Retry::After(d) = dlg.http_failure(&res, json::from_str(&json_err).ok()) {
sleep(d);
sleep_ms(d.num_milliseconds() as u32);
continue;
}
dlg.finished(false);
@@ -2459,8 +2459,8 @@ impl<'a, C, NC, A> DatasetRunQueryCall<'a, C, NC, A> where NC: hyper::net::Netwo
/// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
/// * *alt* (query-string) - Data format for the response.
pub fn param<T>(mut self, name: T, value: T) -> DatasetRunQueryCall<'a, C, NC, A>
where T: Str {
self._additional_params.insert(name.as_slice().to_string(), value.as_slice().to_string());
where T: AsRef<str> {
self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string());
self
}
@@ -2476,8 +2476,8 @@ impl<'a, C, NC, A> DatasetRunQueryCall<'a, C, NC, A> where NC: hyper::net::Netwo
/// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
/// sufficient, a read-write scope will do as well.
pub fn add_scope<T>(mut self, scope: T) -> DatasetRunQueryCall<'a, C, NC, A>
where T: Str {
self._scopes.insert(scope.as_slice().to_string(), ());
where T: AsRef<str> {
self._scopes.insert(scope.as_ref().to_string(), ());
self
}
}
@@ -2494,8 +2494,8 @@ impl<'a, C, NC, A> DatasetRunQueryCall<'a, C, NC, A> where NC: hyper::net::Netwo
///
/// ```test_harness,no_run
/// # extern crate hyper;
/// # extern crate "yup-oauth2" as oauth2;
/// # extern crate "google-datastore1_beta2" as datastore1_beta2;
/// # extern crate yup_oauth2 as oauth2;
/// # extern crate google_datastore1_beta2 as datastore1_beta2;
/// use datastore1_beta2::BeginTransactionRequest;
/// # #[test] fn egal() {
/// # use std::default::Default;
@@ -2562,7 +2562,7 @@ impl<'a, C, NC, A> DatasetBeginTransactionCall<'a, C, NC, A> where NC: hyper::ne
let mut url = "https://www.googleapis.com/datastore/v1beta2/datasets/{datasetId}/beginTransaction".to_string();
if self._scopes.len() == 0 {
self._scopes.insert(Scope::CloudPlatform.as_slice().to_string(), ());
self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ());
}
for &(find_this, param_name) in [("{datasetId}", "datasetId")].iter() {
@@ -2592,7 +2592,7 @@ impl<'a, C, NC, A> DatasetBeginTransactionCall<'a, C, NC, A> where NC: hyper::ne
if params.len() > 0 {
url.push('?');
url.push_str(&url::form_urlencoded::serialize(params.iter().map(|t| (t.0, t.1.as_slice()))));
url.push_str(&url::form_urlencoded::serialize(params.iter().map(|t| (t.0, t.1.as_ref()))));
}
let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default());
@@ -2615,7 +2615,7 @@ impl<'a, C, NC, A> DatasetBeginTransactionCall<'a, C, NC, A> where NC: hyper::ne
request_value_reader.seek(io::SeekFrom::Start(0)).unwrap();
let mut req_result = {
let mut client = &mut *self.hub.client.borrow_mut();
let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.as_slice())
let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.as_ref())
.header(UserAgent(self.hub._user_agent.clone()))
.header(auth_header.clone())
.header(ContentType(json_mime_type.clone()))
@@ -2629,7 +2629,7 @@ impl<'a, C, NC, A> DatasetBeginTransactionCall<'a, C, NC, A> where NC: hyper::ne
match req_result {
Err(err) => {
if let oauth2::Retry::After(d) = dlg.http_error(&err) {
sleep(d);
sleep_ms(d.num_milliseconds() as u32);
continue;
}
dlg.finished(false);
@@ -2640,7 +2640,7 @@ impl<'a, C, NC, A> DatasetBeginTransactionCall<'a, C, NC, A> where NC: hyper::ne
let mut json_err = String::new();
res.read_to_string(&mut json_err).unwrap();
if let oauth2::Retry::After(d) = dlg.http_failure(&res, json::from_str(&json_err).ok()) {
sleep(d);
sleep_ms(d.num_milliseconds() as u32);
continue;
}
dlg.finished(false);
@@ -2714,8 +2714,8 @@ impl<'a, C, NC, A> DatasetBeginTransactionCall<'a, C, NC, A> where NC: hyper::ne
/// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
/// * *alt* (query-string) - Data format for the response.
pub fn param<T>(mut self, name: T, value: T) -> DatasetBeginTransactionCall<'a, C, NC, A>
where T: Str {
self._additional_params.insert(name.as_slice().to_string(), value.as_slice().to_string());
where T: AsRef<str> {
self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string());
self
}
@@ -2731,8 +2731,8 @@ impl<'a, C, NC, A> DatasetBeginTransactionCall<'a, C, NC, A> where NC: hyper::ne
/// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
/// sufficient, a read-write scope will do as well.
pub fn add_scope<T>(mut self, scope: T) -> DatasetBeginTransactionCall<'a, C, NC, A>
where T: Str {
self._scopes.insert(scope.as_slice().to_string(), ());
where T: AsRef<str> {
self._scopes.insert(scope.as_ref().to_string(), ());
self
}
}