Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathquery.rs
More file actions
Latest commit
36 lines (31 loc) · 1.07 KB
/
Copy pathquery.rs
File metadata and controls
36 lines (31 loc) · 1.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
use async_trait::async_trait;
use http::Uri;
use url::Url;
usecrate::api::{ApiError,AsyncClient,Client};
pubfnurl_to_http_uri(url:Url) -> Uri{
url.as_str()
.parse::<Uri>()
.expect("failed to parse a url::Url as an http::Uri")
}
/// A trait which represents a query which may be made to a GitLab client.
pubtraitQuery<T,C>
where
C:Client,
{
/// Perform the query against the client.
fnquery(&self,client:&C) -> Result<T,ApiError<C::Error>>;
}
/// A trait which represents an asynchronous query which may be made to a GitLab client.
#[async_trait]
pubtraitAsyncQuery<T,C>
where
C:AsyncClient,
{
/// Perform the query asynchronously against the client.
asyncfnquery_async(&self,client:&C) -> Result<T,ApiError<C::Error>>;
}