pub(crate) struct ScxcliBackend {
root: bool,
scxcli: PathBuf,
}Fields§
§root: bool§scxcli: PathBufThe absolute path scxcli resolved to, passed as such to pkexec: polkit matches the action on the program’s path, so the name is resolved here, once, in the trusted search path, not by pkexec against whatever PATH it has.
Implementations§
Source§impl ScxcliBackend
impl ScxcliBackend
Sourcepub fn connect() -> Result<Self>
pub fn connect() -> Result<Self>
Checks that scxcli is installed, so startup fails fast with a plain message instead of the first key press.
Sourcepub fn policy_mismatch(&self) -> Option<String>
pub fn policy_mismatch(&self) -> Option<String>
A warning for startup when scxcli is not where the policy expects it, since every privileged action then prompts.
Sourcefn privileged(&self, args: &[&str]) -> Result<Command>
fn privileged(&self, args: &[&str]) -> Result<Command>
A privileged scxcli command: direct as root, else via pkexec. Both are resolved in systemd’s default search path, not scxtui’s PATH.
fn write(&self, args: &[&str]) -> Result<String>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ScxcliBackend
impl RefUnwindSafe for ScxcliBackend
impl Send for ScxcliBackend
impl Sync for ScxcliBackend
impl Unpin for ScxcliBackend
impl UnsafeUnpin for ScxcliBackend
impl UnwindSafe for ScxcliBackend
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more