pub trait SettingsFn<'a>:
Send
+ Sync
+ 'static {
type Fut: Future<Output = Settings<'static, 'static>> + Send + 'a;
// Required method
fn call(&self, conn: &'a Conn) -> Self::Fut;
}Expand description
An async function from &Conn to Settings, as accepted by
HtmlRewriter::new_async.
This trait is implemented for any async closure or async fn that takes a &Conn and
returns Settings<'static, 'static>, as well as for plain closures that return such a future.
The lifetime parameter allows the future to borrow the Conn across .await points; because
of that, the bound in HtmlRewriter::new_async is the higher-ranked
F: for<'a> SettingsFn<'a>.
You should not need to implement or name this trait directly — write one of the closure forms
documented on HtmlRewriter::new_async.
Required Associated Types§
Required Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".