// The same "trait alias" as tower::MakeConnection, but inlined to reduce // dependencies. pubtrait MakeConnection<Target>: self::sealed::Sealed<(Target,)> { type Connection: AsyncRead + AsyncWrite; type Error; type Future: Future<Output = Result<Self::Connection, Self::Error>>;
impl<S, Target> self::sealed::Sealed<(Target,)> for S where S: Service<Target> {}
impl<S, Target> MakeConnection<Target> for S where
S: Service<Target>,
S::Response: AsyncRead + AsyncWrite,
{ type Connection = S::Response; type Error = S::Error; type Future = S::Future;
// Just a sort-of "trait alias" of `MakeService`, not to be implemented // by anyone, only used as bounds. pubtrait MakeServiceRef<Target, ReqBody>: self::sealed::Sealed<(Target, ReqBody)> { type ResBody: HttpBody; type Error: Into<Box<dyn StdError + Send + Sync>>; type Service: HttpService<ReqBody, ResBody = Self::ResBody, Error = Self::Error>; type MakeError: Into<Box<dyn StdError + Send + Sync>>; type Future: Future<Output = Result<Self::Service, Self::MakeError>>;
// Acting like a #[non_exhaustive] for associated types of this trait. // // Basically, no one outside of hyper should be able to set this type // or declare bounds on it, so it should prevent people from creating // trait objects or otherwise writing code that requires using *all* // of the associated types. // // Why? So we can add new associated types to this alias in the future, // if necessary. type __DontNameMe: self::sealed::CantImpl;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.