fix(mbuild): simplification and cleanup

* renamed `*MethodsBuilder` type to `*Methods` type
* renamed `*CallBuilder` type to `*Call` type
* greatly simplified `doit()` signature if uploads are involved
* pass `auth` to upload helper
This commit is contained in:
Sebastian Thiel
2015-03-21 16:27:41 +01:00
parent 307d3f487c
commit 4bf280079e
7 changed files with 1092 additions and 1095 deletions

View File

@@ -302,17 +302,19 @@ impl_header!(XUploadContentType,
Mime);
/// A utility type to perform a resumable upload from start to end.
pub struct ResumableUploadHelper<'a, NC: 'a> {
pub struct ResumableUploadHelper<'a, NC: 'a, A: 'a> {
pub client: &'a mut hyper::client::Client<NC>,
pub delegate: &'a mut Delegate,
pub auth: &'a mut A,
pub url: &'a str,
pub reader: &'a mut ReadSeek,
pub media_type: Mime,
pub content_size: u64
}
impl<'a, NC> ResumableUploadHelper<'a, NC>
where NC: hyper::net::NetworkConnector {
impl<'a, NC, A> ResumableUploadHelper<'a, NC, A>
where NC: hyper::net::NetworkConnector,
A: oauth2::GetToken {
pub fn upload(&'a mut self) -> hyper::HttpResult<hyper::client::Response> {
Err(hyper::error::HttpError::HttpStatusError)
}