Skip to main content

PermissionRequestedArgs

Struct PermissionRequestedArgs 

Source
pub struct PermissionRequestedArgs(/* private fields */);
Expand description

Details about a permission a page is requesting (for example camera or geolocation access), delivered to a WebView::on_permission_requested handler. Decide the outcome with set_state.

Implementations§

Source§

impl PermissionRequestedArgs

Source

pub fn uri(&self) -> String

Returns the URI of the page requesting the permission.

Source

pub fn kind(&self) -> PermissionKind

Returns the kind of permission being requested.

Source

pub fn is_user_initiated(&self) -> bool

Returns true if the request was initiated by the user rather than by script.

Source

pub fn state(&self) -> PermissionState

Returns the current resolution state of the request.

Source

pub fn set_state(&self, state: PermissionState) -> Result<()>

Sets how the request should be resolved.

Source

pub fn defer(&self) -> Result<Deferral>

Takes a Deferral so the request can be resolved after the handler returns, for example once the user has answered a prompt.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.