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 more