pub struct CapabilityBuilder(/* private fields */);Available on crate feature
dynamic-acl only.Expand description
A builder for a Capability.
Implementations§
Source§impl CapabilityBuilder
impl CapabilityBuilder
Sourcepub fn new(identifier: impl Into<String>) -> Self
pub fn new(identifier: impl Into<String>) -> Self
Creates a new capability builder with a unique identifier.
Sourcepub fn local(self, local: bool) -> Self
pub fn local(self, local: bool) -> Self
Whether this capability is applied on local app URLs or not. Defaults to true.
Sourcepub fn window(self, window: impl Into<String>) -> Self
pub fn window(self, window: impl Into<String>) -> Self
Link this capability to the given window label.
Sourcepub fn windows(
self,
windows: impl IntoIterator<Item = impl Into<String>>,
) -> Self
pub fn windows( self, windows: impl IntoIterator<Item = impl Into<String>>, ) -> Self
Link this capability to the a list of window labels.
Sourcepub fn webview(self, webview: impl Into<String>) -> Self
pub fn webview(self, webview: impl Into<String>) -> Self
Link this capability to the given webview label.
Sourcepub fn webviews(
self,
webviews: impl IntoIterator<Item = impl Into<String>>,
) -> Self
pub fn webviews( self, webviews: impl IntoIterator<Item = impl Into<String>>, ) -> Self
Link this capability to the a list of window labels.
Sourcepub fn permission(self, permission: impl Into<String>) -> Self
pub fn permission(self, permission: impl Into<String>) -> Self
Add a new permission to this capability.
Sourcepub fn permission_scoped<T: Serialize>(
self,
permission: impl Into<String>,
allowed: Vec<T>,
denied: Vec<T>,
) -> Self
pub fn permission_scoped<T: Serialize>( self, permission: impl Into<String>, allowed: Vec<T>, denied: Vec<T>, ) -> Self
Add a new scoped permission to this capability.
Sourcepub fn platform(self, platform: Target) -> Self
pub fn platform(self, platform: Target) -> Self
Adds a target platform for this capability.
By default all platforms are applied.
Sourcepub fn platforms(self, platforms: impl IntoIterator<Item = Target>) -> Self
pub fn platforms(self, platforms: impl IntoIterator<Item = Target>) -> Self
Adds target platforms for this capability.
By default all platforms are applied.
Trait Implementations§
Source§impl RuntimeCapability for CapabilityBuilder
impl RuntimeCapability for CapabilityBuilder
Source§fn build(self) -> CapabilityFile
fn build(self) -> CapabilityFile
Creates the capability file.
Auto Trait Implementations§
impl Freeze for CapabilityBuilder
impl RefUnwindSafe for CapabilityBuilder
impl Send for CapabilityBuilder
impl Sync for CapabilityBuilder
impl Unpin for CapabilityBuilder
impl UnsafeUnpin for CapabilityBuilder
impl UnwindSafe for CapabilityBuilder
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