pub struct WebviewResponder<F> { /* private fields */ }Expand description
Answers a webview’s custom-protocol requests in-process with an HTTP
service, such as an axum Router or a FetchletService.
A custom URI scheme passes each request with its whole body and takes a
whole response, as Tauri’s UriSchemeResponder does, so the responder
collects each response body. response_body_bytes bounds what it
collects: it is the caller’s memory budget for one response, since the
body is held in full before the webview receives it. A larger response
becomes a 502 Bad Gateway.
services makes the service for each request, so a host that replaces
its application, such as one using DevReload’s
current, answers each request with the build current when it arrives.
Implementations§
Source§impl<F> WebviewResponder<F>
impl<F> WebviewResponder<F>
Sourcepub fn new(services: F, response_body_bytes: usize) -> Self
pub fn new(services: F, response_body_bytes: usize) -> Self
A responder that answers with the service services returns for each
request, collecting at most response_body_bytes of each response.