pub struct PolkitAgent { /* private fields */ }Expand description
The shell’s polkit agent, from cx.polkit_agent(). A clone is cheap
and shares the one agent.
Implementations§
Source§impl PolkitAgent
impl PolkitAgent
Sourcepub fn request(&self) -> ReadSignal<Option<AuthRequest>>
pub fn request(&self) -> ReadSignal<Option<AuthRequest>>
The request being answered now, or None. One shows at a time; up
to 8 more wait their turn, and polkit is told any past that failed.
Sourcepub fn respond(&self, text: impl Into<String>)
pub fn respond(&self, text: impl Into<String>)
Answers the request’s question, as the user typed it. After a failure, it tries again and answers the new try’s first question. At any other time, or with a line break in it, it is dropped. It is never logged, and its bytes are zeroed once sent.
Sourcepub fn cancel(&self)
pub fn cancel(&self)
Gives up on the request, as the user’s cancel button does, and tells polkit so.
Sourcepub fn pick_identity(&self, name: &str)
pub fn pick_identity(&self, name: &str)
Asks name, one of the request’s identities, instead: it moves to
the front, and the conversation starts again as that user. An
unknown name is logged.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for PolkitAgent
impl !Send for PolkitAgent
impl !Sync for PolkitAgent
impl !UnwindSafe for PolkitAgent
impl Forget for PolkitAgent
impl Freeze for PolkitAgent
impl Move for PolkitAgent
impl Unpin for PolkitAgent
impl UnsafeUnpin for PolkitAgent
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