Skip to content

Commit

Permalink
Introduce Client and Connection
Browse files Browse the repository at this point in the history
  • Loading branch information
IvanUkhov committed Oct 3, 2024
1 parent 70bfc8f commit 6d3710f
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions google-apis-common/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@ pub type Body = http_body_util::Full<hyper::body::Bytes>;
pub type Response = hyper::Response<Body>;

/// A client.
pub trait Client:
pub type Client<C> = hyper_util::client::legacy::Client<C, Body>;

/// A connection.
pub trait Connection:
hyper_util::client::legacy::connect::Connect + Clone + Send + Sync + 'static
{
}
Expand Down Expand Up @@ -577,9 +580,9 @@ impl RangeResponseHeader {
/// A utility type to perform a resumable upload from start to end.
pub struct ResumableUploadHelper<'a, A: 'a, C>
where
C: Client,
C: Connection,
{
pub client: &'a hyper_util::client::legacy::Client<C, Body>,
pub client: &'a Client<C>,
pub delegate: &'a mut dyn Delegate,
pub start_at: Option<u64>,
pub auth: &'a A,
Expand All @@ -593,7 +596,7 @@ where

impl<'a, A, C> ResumableUploadHelper<'a, A, C>
where
C: Client,
C: Connection,
{
async fn query_transfer_status(
&mut self,
Expand Down

0 comments on commit 6d3710f

Please sign in to comment.