//! Codegen exports used by `tonic-build`.

pub use async_trait::async_trait;
pub use futures_core::Stream;
pub use futures_util::future::{ok, poll_fn, Ready};

pub use http_body::Body as HttpBody;
pub use std::future::Future;
pub use std::pin::Pin;
pub use std::sync::Arc;
pub use std::task::{Context, Poll};
pub use tower_service::Service;
pub type StdError = Box<dyn std::error::Error + Send + Sync + 'static>;
pub use crate::body::Body;

#[cfg(feature = "transport")]
pub use hyper::Body as HyperBody;

pub type BoxFuture<T, E> = self::Pin<Box<dyn self::Future<Output = Result<T, E>> + Send + 'static>>;
pub type BoxStream<T> =
    self::Pin<Box<dyn futures_core::Stream<Item = Result<T, crate::Status>> + Send + 'static>>;

pub mod http {
    pub use http::*;
}

#[derive(Debug)]
pub enum Never {}

impl std::fmt::Display for Never {
    fn fmt(&self, _: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        match *self {}
    }
}

impl std::error::Error for Never {}

pub use bytes::*;
pub use prost::*;
pub use prost_derive::*;
