Struct tauri::plugin::TauriPlugin
source · [−]pub struct TauriPlugin<R: Runtime, C: DeserializeOwned = ()> { /* private fields */ }
Expand description
Plugin struct that is returned by the Builder
. Should only be constructed through the builder.
Trait Implementations
sourceimpl<R: Runtime, C: DeserializeOwned> Plugin<R> for TauriPlugin<R, C>
impl<R: Runtime, C: DeserializeOwned> Plugin<R> for TauriPlugin<R, C>
sourcefn initialize(&mut self, app: &AppHandle<R>, config: JsonValue) -> Result<()>
fn initialize(&mut self, app: &AppHandle<R>, config: JsonValue) -> Result<()>
Initializes the plugin.
sourcefn initialization_script(&self) -> Option<String>
fn initialization_script(&self) -> Option<String>
The JS script to evaluate on webview initialization.
The script is wrapped into its own context with (function () { /* your script here */ })();
,
so global variables must be assigned to window
instead of implicity declared. Read more
sourcefn on_page_load(&mut self, window: Window<R>, payload: PageLoadPayload)
fn on_page_load(&mut self, window: Window<R>, payload: PageLoadPayload)
Callback invoked when the webview performs a navigation to a page.
sourcefn on_event(&mut self, app: &AppHandle<R>, event: &RunEvent)
fn on_event(&mut self, app: &AppHandle<R>, event: &RunEvent)
Callback invoked when the event loop receives a new event.
sourcefn extend_api(&mut self, invoke: Invoke<R>)
fn extend_api(&mut self, invoke: Invoke<R>)
Extend commands to crate::Builder::invoke_handler
.
Auto Trait Implementations
impl<R, C = ()> !RefUnwindSafe for TauriPlugin<R, C>
impl<R, C> Send for TauriPlugin<R, C>
impl<R, C = ()> !Sync for TauriPlugin<R, C>
impl<R, C> Unpin for TauriPlugin<R, C>
impl<R, C = ()> !UnwindSafe for TauriPlugin<R, C>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more