WindowsSettingsDefaultTerminalApplicationGuard

Struct WindowsSettingsDefaultTerminalApplicationGuard 

pub struct WindowsSettingsDefaultTerminalApplicationGuard<R: Registry> {
    pub(crate) old_windows_terminal_console: Option<String>,
    pub(crate) old_windows_terminal_terminal: Option<String>,
    pub(crate) registry: R,
}
Expand description

Guard storing previous/old DelegationConsole and DelegationTerminal registry values.

Configures conhost.exe as the default terminal application and reverts to the original configuration when being dropped.

Fields§

§old_windows_terminal_console: Option<String>

Old DelegationConsole registry value

§old_windows_terminal_terminal: Option<String>

Old DelegationTerminal registry value

§registry: R

Registry operations trait

Implementations§

§

impl<R: Registry> WindowsSettingsDefaultTerminalApplicationGuard<R>

pub fn new_with_registry(registry: R) -> Self

Create a new guard with the given registry operations

§Arguments
  • registry - Registry operations implementation
§Returns

A new guard that will restore registry values on drop

§

impl WindowsSettingsDefaultTerminalApplicationGuard<DefaultRegistry>

pub fn new() -> Self

Create a new guard with production registry operations

Trait Implementations§

§

impl<R> Default for WindowsSettingsDefaultTerminalApplicationGuard<R>
where R: Default + Registry,

§

fn default() -> Self

Returns the “default value” for a type. Read more
§

impl<R: Registry> Drop for WindowsSettingsDefaultTerminalApplicationGuard<R>

§

fn drop(&mut self)

Restore the original default terminal application setting to the registry.

If old values weren’t stored, nothing is done.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.