Struct WindowsSettingsDefaultTerminalApplicationGuard
pub struct WindowsSettingsDefaultTerminalApplicationGuard<R: Registry> {
pub(crate) changed: bool,
pub(crate) key_existed: bool,
pub(crate) old_windows_terminal_console: Option<String>,
pub(crate) old_windows_terminal_terminal: Option<String>,
pub(crate) registry: R,
}Expand description
Guard that configures conhost.exe as the default terminal application and
fully reverts its changes when dropped.
Restoration is exact: values the guard overwrote are set back, values it created are deleted, and a startup key the guard had to create is removed.
Fields§
§changed: boolWhether the guard changed the registry and must undo it on drop.
key_existed: boolWhether the startup key existed before the guard; if not, drop deletes it.
old_windows_terminal_console: Option<String>DelegationConsole before the guard overwrote it, or None if it was absent.
old_windows_terminal_terminal: Option<String>DelegationTerminal before the guard overwrote it, or None if it was absent.
registry: RRegistry operations trait
Implementations§
§impl<R: Registry> WindowsSettingsDefaultTerminalApplicationGuard<R>
impl<R: Registry> WindowsSettingsDefaultTerminalApplicationGuard<R>
pub fn new_with_registry(registry: R) -> Self
pub fn new_with_registry(registry: R) -> Self
pub(crate) fn restore_value(&self, name: &str, previous: &Option<String>)
pub(crate) fn restore_value(&self, name: &str, previous: &Option<String>)
Restore name to its pre-guard value, or delete it if it was absent.
§impl WindowsSettingsDefaultTerminalApplicationGuard<DefaultRegistry>
impl WindowsSettingsDefaultTerminalApplicationGuard<DefaultRegistry>
pub fn new() -> Self
pub fn new() -> Self
Create a new guard with production registry operations
Trait Implementations§
§impl<R> Default for WindowsSettingsDefaultTerminalApplicationGuard<R>
impl<R> Default for WindowsSettingsDefaultTerminalApplicationGuard<R>
§impl<R: Registry> Drop for WindowsSettingsDefaultTerminalApplicationGuard<R>
impl<R: Registry> Drop for WindowsSettingsDefaultTerminalApplicationGuard<R>
Auto Trait Implementations§
impl<R> Freeze for WindowsSettingsDefaultTerminalApplicationGuard<R>where
R: Freeze,
impl<R> RefUnwindSafe for WindowsSettingsDefaultTerminalApplicationGuard<R>where
R: RefUnwindSafe,
impl<R> Send for WindowsSettingsDefaultTerminalApplicationGuard<R>where
R: Send,
impl<R> Sync for WindowsSettingsDefaultTerminalApplicationGuard<R>where
R: Sync,
impl<R> Unpin for WindowsSettingsDefaultTerminalApplicationGuard<R>where
R: Unpin,
impl<R> UnsafeUnpin for WindowsSettingsDefaultTerminalApplicationGuard<R>where
R: UnsafeUnpin,
impl<R> UnwindSafe for WindowsSettingsDefaultTerminalApplicationGuard<R>where
R: UnwindSafe,
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