RPYFPVVK6EQGDFVCKLMCZUITZ3CP26X4PWCTM2BGTZQVDIAJKOFAC
/// This is just an alias for [`tower_service::Service`](tower_service::Service)
/// introduced to reduce the number of type parameters in `Builder::listen_with_client`.
pub trait HttpService<B>: Sealed<B> {
/// This is just an alias for [`tower_service::Service`] introduced to reduce the number of type
/// parameters.
pub trait HttpService<B>: service_private::Sealed<B> {
fn _into_service(self, _seal: Seal) -> IntoService<Self>
where
Self: Sized,
{
IntoService(self)
fn _try_poll(
self: Pin<&mut Self>,
cx: &mut Context<'_>,
_seal: Seal,
) -> Poll<Result<Response<Self::Body>, Self::Error>>;
}
impl<F, B> HttpTryFuture for F
where
F: TryFuture<Ok = Response<B>>,
B: Body,
{
type Body = B;
type Error = F::Error;
#[doc(hidden)]
fn _try_poll(
self: Pin<&mut Self>,
cx: &mut Context<'_>,
_seal: Seal,
) -> Poll<Result<Response<B>, F::Error>> {
self.try_poll(cx)
impl<S, B> Service<Request<B>> for IntoService<S>
where
S: HttpService<B>,
{
type Response = Response<<S as HttpService<B>>::ResponseBody>;
type Error = S::Error;
type Future = S::Future;
fn poll_ready(&mut self, cx: &mut Context<'_>) -> Poll<Result<(), S::Error>> {
HttpService::_poll_ready(&mut self.0, cx, Seal)
}
fn call(&mut self, request: Request<B>) -> Self::Future {
HttpService::_call(&mut self.0, request, Seal)
}
mod future_private {
pub trait Sealed {}
impl<T: de::DeserializeOwned, S, B> ResponseFuture<T, S, B>
where
S: HttpService<B>,
{
pub(crate) fn new(req: http::Request<B>, http: S) -> Self {
impl<T: de::DeserializeOwned, F: HttpTryFuture> ResponseFuture<T, F> {
pub(crate) fn new<S, B>(req: http::Request<B>, http: &mut S) -> Self
where
S: HttpService<B, Future = F>,
{
impl<S, B> ResponseFutureInner<S, B>
where
S: HttpService<B>,
{
pub(crate) fn new(req: http::Request<B>, http: S) -> Self {
impl<F: HttpTryFuture> ResponseFutureInner<F> {
pub(crate) fn new<S, B>(req: http::Request<B>, http: &mut S) -> Self
where
S: HttpService<B, Future = F>,
{
impl<T: de::DeserializeOwned, S, B> AuthFuture<T, S, B>
where
S: HttpService<B>,
{
pub(crate) fn new(req: http::Request<B>, http: S) -> Self {
impl<T: de::DeserializeOwned, F: HttpTryFuture> AuthFuture<T, F> {
pub(crate) fn new<S, B>(req: http::Request<B>, http: &mut S) -> Self
where
S: HttpService<B, Future = F>,
{
pub fn access_token<'a, S, B>(
oauth_verifier: &'a str,
client_credentials: Credentials<&'a str>,
temporary_credentials: Credentials<&'a str>,
client: S,
) -> AuthFuture<AccessToken, S, B>
pub fn access_token<S, B>(
oauth_verifier: &str,
client_credentials: Credentials<&str>,
temporary_credentials: Credentials<&str>,
client: &mut S,
) -> AuthFuture<AccessToken, S::Future>