pub struct Builder<R: Runtime> { /* private fields */ }
Implementations§
Source§impl<R: Runtime> Builder<R>
impl<R: Runtime> Builder<R>
pub fn new() -> Self
Sourcepub fn with_flags(self, flags: Flags) -> Self
pub fn with_flags(self, flags: Flags) -> Self
Set flags to control which shortcuts the plugin should disable.
§Examples
use tauri_plugin_prevent_default::Flags;
tauri_plugin_prevent_default::Builder::new()
.with_flags(Flags::CONTEXT_MENU | Flags::PRINT | Flags::DOWNLOADS)
.build();
Sourcepub fn shortcut<S>(self, shortcut: S) -> Selfwhere
S: Shortcut<R> + 'static,
pub fn shortcut<S>(self, shortcut: S) -> Selfwhere
S: Shortcut<R> + 'static,
Disable a custom shortcut.
§Examples
use tauri_plugin_prevent_default::KeyboardShortcut;
use tauri_plugin_prevent_default::ModifierKey::{CtrlKey, ShiftKey};
tauri_plugin_prevent_default::Builder::new()
.shortcut(KeyboardShortcut::new("F12"))
.shortcut(KeyboardShortcut::with_modifiers("E", &[CtrlKey, ShiftKey]))
.shortcut(KeyboardShortcut::with_shift_alt("I"))
.build();
Sourcepub fn check_origin(self, origin: impl AsRef<str>) -> Self
pub fn check_origin(self, origin: impl AsRef<str>) -> Self
Check location origin before disabling the shortcuts.
Sourcepub fn build(self) -> TauriPlugin<R>
pub fn build(self) -> TauriPlugin<R>
Build the plugin.
Trait Implementations§
Auto Trait Implementations§
impl<R> Freeze for Builder<R>
impl<R> !RefUnwindSafe for Builder<R>
impl<R> !Send for Builder<R>
impl<R> !Sync for Builder<R>
impl<R> Unpin for Builder<R>
impl<R> !UnwindSafe for Builder<R>
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more