pub struct Access {
pub declared: Capabilities,
pub granted: Option<Capabilities>,
}Expand description
What an app may do: its declaration and the embedder’s grant (when the embedder limits it); an action must be allowed by both.
Fields§
§declared: CapabilitiesWhat the app declared (everything without a declaration).
granted: Option<Capabilities>What the embedding app grants it at most (None: what it declared).
Implementations§
Source§impl Access
impl Access
Sourcepub fn is_unrestricted(&self) -> bool
pub fn is_unrestricted(&self) -> bool
True when nothing is restricted (no check needed, redirects may be followed by the platform).
Sourcepub fn allows_http(&self, method: &str, url: &str) -> bool
pub fn allows_http(&self, method: &str, url: &str) -> bool
Whether fetch(url, { method }) may go out. asset: URIs are always
allowed.
Sourcepub fn allows_media(&self, uri: &str) -> bool
pub fn allows_media(&self, uri: &str) -> bool
Whether a media URL (image, video, canvas image) may be loaded.
Relative and asset: URIs are the app’s own files.
Sourcepub fn media_redirect(
&self,
base: &str,
location: &str,
) -> Result<String, String>
pub fn media_redirect( &self, base: &str, location: &str, ) -> Result<String, String>
The next URL of a media load that was redirected from base to
location, if the app may load it: the redirect must stay on
http(s) and pass the same check as a first request, so loaders
follow redirects themselves, one hop at a time, and never contact
a target the app is not granted.
Sourcepub fn allows_webviews(&self) -> bool
pub fn allows_webviews(&self) -> bool
Whether web views are granted at all (inline HTML needs only this).
Sourcepub fn allows_webview(&self, url: &str) -> bool
pub fn allows_webview(&self, url: &str) -> bool
Whether a web view may show (or navigate to) url; about:blank
whenever web views are granted.
Sourcepub fn allows_status_bar(&self) -> bool
pub fn allows_status_bar(&self) -> bool
Whether the app may set the status bar.
Sourcepub fn allows_clipboard(&self) -> bool
pub fn allows_clipboard(&self) -> bool
Whether the app may read and write the system clipboard.
Trait Implementations§
impl Eq for Access
impl StructuralPartialEq for Access
Auto Trait Implementations§
impl Freeze for Access
impl RefUnwindSafe for Access
impl Send for Access
impl Sync for Access
impl Unpin for Access
impl UnsafeUnpin for Access
impl UnwindSafe for Access
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§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.