tauriless/web_view_builder_ext.rs
1use crate::Commands;
2
3/// An [extension trait] for [`wry::WebViewBuilder`]. Notably, implements
4/// [`with_tauriless_commands`](WebViewBuilderExt::with_tauriless_commands).
5///
6/// [extension trait]: https://rust-lang.github.io/rfcs/0445-extension-trait-conventions.html
7pub trait WebViewBuilderExt {
8 fn with_tauriless_commands<C: Commands>(self, commands: C) -> Self;
9}
10
11impl<'a> WebViewBuilderExt for wry::WebViewBuilder<'a> {
12 fn with_tauriless_commands<C: Commands>(self, commands: C) -> Self {
13 commands.register_commands(self)
14 }
15}