mirror of
https://github.com/OMGeeky/google-apis-rs.git
synced 2026-01-24 12:15:55 +01:00
fix(hyper-client): adjust to hyper client
* deal with hyper client not using a type-parameter anymore * fix incorrect documentation link (use '_' instead of '-') Fixes #47
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
<%! from util import (estr, hash_comment, library_to_crate_name) %>\
|
||||
<%! from util import (estr, hash_comment, library_to_crate_name, to_extern_crate_name) %>\
|
||||
<%namespace name="util" file="lib/util.mako"/>\
|
||||
<%block filter="hash_comment">\
|
||||
<%util:gen_info source="${self.uri}" />\
|
||||
@@ -13,7 +13,7 @@ repository = "${util.github_source_root_url()}"
|
||||
% if documentationLink is not UNDEFINED and documentationLink:
|
||||
homepage = "${documentationLink}"
|
||||
% endif
|
||||
documentation = "${cargo.doc_base_url}/${util.crate_name()}"
|
||||
documentation = "${cargo.doc_base_url}/${to_extern_crate_name(util.crate_name())}"
|
||||
license = "${copyright.license_abbrev}"
|
||||
keywords = ["${name[:20]}", ${", ".join(estr(cargo.keywords))}]
|
||||
|
||||
|
||||
@@ -46,7 +46,6 @@ use std::cell::RefCell;
|
||||
use std::borrow::BorrowMut;
|
||||
use std::default::Default;
|
||||
use std::collections::BTreeMap;
|
||||
use std::marker::PhantomData;
|
||||
use serde::json;
|
||||
use std::io;
|
||||
use std::fs;
|
||||
@@ -79,8 +78,6 @@ pub struct ${hub_type}${ht_params} {
|
||||
client: RefCell<C>,
|
||||
auth: RefCell<A>,
|
||||
_user_agent: String,
|
||||
|
||||
_m: PhantomData<NC>
|
||||
}
|
||||
|
||||
impl<'a, ${', '.join(HUB_TYPE_PARAMETERS)}> Hub for ${hub_type}${ht_params} {}
|
||||
@@ -93,7 +90,6 @@ impl<'a, ${', '.join(HUB_TYPE_PARAMETERS)}> ${hub_type}${ht_params}
|
||||
client: RefCell::new(client),
|
||||
auth: RefCell::new(authenticator),
|
||||
_user_agent: "${default_user_agent}".to_string(),
|
||||
_m: PhantomData
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -109,7 +109,7 @@ data_unit_multipliers = {
|
||||
'%': 1,
|
||||
}
|
||||
|
||||
HUB_TYPE_PARAMETERS = ('C', 'NC', 'A')
|
||||
HUB_TYPE_PARAMETERS = ('C', 'A')
|
||||
|
||||
# ==============================================================================
|
||||
## @name Filters
|
||||
@@ -827,8 +827,7 @@ def hub_type_params_s():
|
||||
|
||||
# return a list of where statements to server as bounds for the hub.
|
||||
def hub_type_bounds():
|
||||
return ['NC: hyper::net::NetworkConnector',
|
||||
'C: BorrowMut<hyper::Client<NC>>',
|
||||
return ['C: BorrowMut<hyper::Client>',
|
||||
'A: oauth2::GetToken']
|
||||
|
||||
# Returns True if this API has particular authentication scopes to choose from
|
||||
|
||||
@@ -481,8 +481,8 @@ impl HeaderFormat for RangeResponseHeader {
|
||||
}
|
||||
|
||||
/// A utility type to perform a resumable upload from start to end.
|
||||
pub struct ResumableUploadHelper<'a, NC: 'a, A: 'a> {
|
||||
pub client: &'a mut hyper::client::Client<NC>,
|
||||
pub struct ResumableUploadHelper<'a, A: 'a> {
|
||||
pub client: &'a mut hyper::client::Client,
|
||||
pub delegate: &'a mut Delegate,
|
||||
pub start_at: Option<u64>,
|
||||
pub auth: &'a mut A,
|
||||
@@ -494,9 +494,8 @@ pub struct ResumableUploadHelper<'a, NC: 'a, A: 'a> {
|
||||
pub content_length: u64
|
||||
}
|
||||
|
||||
impl<'a, NC, A> ResumableUploadHelper<'a, NC, A>
|
||||
where NC: hyper::net::NetworkConnector,
|
||||
A: oauth2::GetToken {
|
||||
impl<'a, A> ResumableUploadHelper<'a, A>
|
||||
where A: oauth2::GetToken {
|
||||
|
||||
fn query_transfer_status(&mut self) -> std::result::Result<u64, hyper::HttpResult<hyper::client::Response>> {
|
||||
loop {
|
||||
|
||||
Reference in New Issue
Block a user