impl<F> OnInformationalCallback for OnInformationalClosure<F> where
F: Fn(Response<'_>) + Send + Sync + 'static,
{ fn on_informational(&self, res: http::Response<()>) { let res = Response(&res);
(self.0)(res);
}
}
// A facade over http::Response. // // It purposefully hides being able to move the response out of the closure, // while also not being able to expect it to be a reference `&Response`. // (Otherwise, a closure can be written as `|res: &_|`, and then be broken if // we make the closure take ownership.) // // With the type not being nameable, we could change from being a facade to // being either a real reference, or moving the http::Response into the closure, // in a backwards-compatible change in the future. #[derive(Debug)] pubstruct Response<'a>(&'a http::Response<()>);
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.