pub enum Elevation {
Prompt,
Unattended {
root: bool,
},
}Expand description
How a step that needs an administrator is elevated. With someone there to answer, the OS’s
password prompt (pkexec’s on Linux, macOS’s own); with nobody (a script, a machine set up
unattended), no prompt may be raised: as is when the process is root already, else through
sudo -n, refused at once rather than waiting on a password.
Variants§
Prompt
The OS’s password prompt: pkexec’s (Linux), macOS’s administrator prompt.
Unattended
Unattended, root when the process is root already.
Implementations§
Source§impl Elevation
impl Elevation
Sourcepub async fn here(cx: &Context, desktop: bool) -> Result<Elevation, NoElevation>
pub async fn here(cx: &Context, desktop: bool) -> Result<Elevation, NoElevation>
How a root step is elevated on the context’s host when nobody chose: as is when root;
through sudo -n only when it runs a command without a password (sudo -n true); else
through the OS’s password prompt where a login session can show it (macOS’s administrator
prompt at the Mac’s screen, launchctl managername saying Aqua; pkexec’s on a Linux
desktop, desktop saying one is there); else refused. Windows always asks through UAC.
An app with someone at it asks through the prompt without this (Elevation::Prompt).
§Errors
NoElevation: why no root step can run here.
Trait Implementations§
impl Copy for Elevation
impl Eq for Elevation
impl StructuralPartialEq for Elevation
Auto Trait Implementations§
impl Forget for Elevation
impl Freeze for Elevation
impl Move for Elevation
impl RefUnwindSafe for Elevation
impl Send for Elevation
impl Sync for Elevation
impl Unpin for Elevation
impl UnsafeUnpin for Elevation
impl UnwindSafe for Elevation
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§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.