pub struct UserToolGate {
notifications: UnboundedSender<Notification>,
}Expand description
A [ToolGate] that sends a permission request to the UI and waits for the user’s decision.
Each call to [ToolGate::permitted()] sends a
ui::Notification::RequestPermission across the UI-notification channel and blocks until
the UI sends the user’s decision back across the request’s oneshot channel. If the UI is
dropped before a decision is made (e.g. the application exits while a prompt is pending),
the request is treated as a rejection.
Fields§
§notifications: UnboundedSender<Notification>The UI-notification channel to send permission requests across.
Implementations§
Source§impl UserToolGate
impl UserToolGate
Sourcepub fn new(notifications: &NotificationChannel) -> Self
pub fn new(notifications: &NotificationChannel) -> Self
Create a new gate over the given UI-notification channel.
Trait Implementations§
Source§impl Clone for UserToolGate
impl Clone for UserToolGate
Source§fn clone(&self) -> UserToolGate
fn clone(&self) -> UserToolGate
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for UserToolGate
impl Debug for UserToolGate
Auto Trait Implementations§
impl Freeze for UserToolGate
impl RefUnwindSafe for UserToolGate
impl Send for UserToolGate
impl Sync for UserToolGate
impl Unpin for UserToolGate
impl UnsafeUnpin for UserToolGate
impl UnwindSafe for UserToolGate
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