pub struct InlinedPlugin { /* private fields */ }
Expand description
Definition of a plugin that is part of the Tauri application instead of having its own crate.
By default it generates a plugin manifest that parses permissions from the permissions/$plugin-name
directory.
To change the glob pattern that is used to find permissions, use Self::permissions_path_pattern
.
To autogenerate permissions for each of the plugin commands, see Self::commands
.
Implementations§
Source§impl InlinedPlugin
impl InlinedPlugin
pub fn new() -> Self
Sourcepub fn commands(self, commands: &'static [&'static str]) -> Self
pub fn commands(self, commands: &'static [&'static str]) -> Self
Define a list of commands that gets permissions autogenerated in the format of allow-$command
and deny-$command
where $command is the command name in snake_case.
Sourcepub fn permissions_path_pattern(self, pattern: &'static str) -> Self
pub fn permissions_path_pattern(self, pattern: &'static str) -> Self
Sets a glob pattern that is used to find the permissions of this inlined plugin.
Note: You must emit [rerun-if-changed] instructions for the plugin permissions directory.
By default it is ./permissions/$plugin-name/**/*
Sourcepub fn default_permission(self, default: DefaultPermissionRule) -> Self
pub fn default_permission(self, default: DefaultPermissionRule) -> Self
Creates a default permission for the plugin using the given rule.
Alternatively you can pull a permission in the filesystem in the permissions directory, see Self::permissions_path_pattern
.
Trait Implementations§
Source§impl Clone for InlinedPlugin
impl Clone for InlinedPlugin
Source§fn clone(&self) -> InlinedPlugin
fn clone(&self) -> InlinedPlugin
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for InlinedPlugin
impl Debug for InlinedPlugin
Source§impl Default for InlinedPlugin
impl Default for InlinedPlugin
Source§fn default() -> InlinedPlugin
fn default() -> InlinedPlugin
Auto Trait Implementations§
impl Freeze for InlinedPlugin
impl RefUnwindSafe for InlinedPlugin
impl Send for InlinedPlugin
impl Sync for InlinedPlugin
impl Unpin for InlinedPlugin
impl UnwindSafe for InlinedPlugin
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)