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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.