pub struct Builder { /* private fields */ }Expand description
Configures the plugin (id socketio).
Subscriptions of a webview end when it starts loading a new page or its window is destroyed, so a reload never leaves listeners behind.
Implementations§
Source§impl Builder
impl Builder
Sourcepub fn allow_url_prefix(self, prefix: impl AsRef<str>) -> Self
pub fn allow_url_prefix(self, prefix: impl AsRef<str>) -> Self
Lets the webview connect only to URLs under prefix (same scheme, host and port;
the path must start with the prefix’s path on a / boundary). Call it once per
allowed server; without any call every URL is allowed. Rust’s
SocketIo::connect and SocketIo::insert are never restricted.
The socket runs in Rust, so the app’s CSP connect-src does not apply to it: with
allow-connect, a page script could otherwise open connections anywhere with any
headers.
§Panics
When prefix is not an absolute URL (a configuration bug, found at startup).
Sourcepub fn build<R: Runtime>(self) -> TauriPlugin<R>
pub fn build<R: Runtime>(self) -> TauriPlugin<R>
The plugin.
Trait Implementations§
Auto Trait Implementations§
impl Forget for Builder
impl Freeze for Builder
impl Move for Builder
impl RefUnwindSafe for Builder
impl Send for Builder
impl Sync for Builder
impl Unpin for Builder
impl UnsafeUnpin for Builder
impl UnwindSafe for Builder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more