diff options
Diffstat (limited to 'crates/common/tedge_users/src/windows.rs')
-rw-r--r-- | crates/common/tedge_users/src/windows.rs | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/crates/common/tedge_users/src/windows.rs b/crates/common/tedge_users/src/windows.rs new file mode 100644 index 00000000..f529cdd2 --- /dev/null +++ b/crates/common/tedge_users/src/windows.rs @@ -0,0 +1,37 @@ +use std::fmt; +use std::marker::PhantomData; +use std::rc::Rc; + +#[derive(Clone)] +pub struct UserManager { + _force_not_send: PhantomData<Rc<()>>, +} + +impl fmt::Debug for UserManager { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + f.debug_struct("UserManager").finish() + } +} + +pub struct UserGuard { + _force_not_send: PhantomData<Rc<()>>, +} + +impl UserManager { + pub fn new() -> UserManager { + UserManager { + _force_not_send: PhantomData, + } + } + + #[allow(dead_code)] + pub fn running_as_root() -> bool { + false + } + + pub fn become_user(&self, _username: &str) -> Result<UserGuard, super::UserSwitchError> { + Ok(UserGuard { + _force_not_send: PhantomData, + }) + } +} |