Skip to main content

Resolution

Struct Resolution 

Source
pub struct Resolution {
    pub dll_overrides: Vec<DllOverride>,
    pub dll_overrides_from: Vec<Origin>,
    pub dll_overrides_reset: Vec<DllOverrideReset>,
    pub arguments: Vec<Argument>,
    pub arguments_from: Vec<Origin>,
    pub arguments_dropped: Vec<ArgumentsDropped>,
    pub debug_channels: Vec<DebugChannel>,
    pub debug_channels_from: Vec<Origin>,
    pub env: Vec<EnvEntry>,
    pub env_from: Vec<EnvFrom>,
    /* private fields */
}
Expand description

The settings that apply to one process.

Every matching rule folded in the order Table::resolve describes, so a scalar holds the value of the last rule that set it and the lists accumulate. Also says where each value came from, for the log.

Fields§

§dll_overrides: Vec<DllOverride>

The dll_overrides entries of every matching rule in fold order, without the default entries, which only take modules out of the entries before them.

§dll_overrides_from: Vec<Origin>

Where each entry of Resolution::dll_overrides came from, at the same index.

§dll_overrides_reset: Vec<DllOverrideReset>

Each module a <module>=default entry named, in fold order, with what that did to the entries before it.

§arguments: Vec<Argument>

The texts to append to the command line, in fold order, after any arguments_override replaced what came before it.

§arguments_from: Vec<Origin>

Where each entry of Resolution::arguments came from, at the same index.

§arguments_dropped: Vec<ArgumentsDropped>

Each arguments_override that dropped entries from the argument list, in fold order.

§debug_channels: Vec<DebugChannel>

The debug_channels entries of every matching rule in fold order, which compatdb.so only logs (see Rule::debug_channels).

§debug_channels_from: Vec<Origin>

Where each entry of Resolution::debug_channels came from, at the same index.

§env: Vec<EnvEntry>

The env entries of every matching rule in fold order, followed by those Resolution::fold_derived_env adds. Resolution::env_steps says which of them apply in a process.

§env_from: Vec<EnvFrom>

Where each entry of Resolution::env came from, at the same index.

Implementations§

Source§

impl Resolution

Source

pub fn is_empty(&self) -> bool

Whether there is nothing to apply or log: no value of a scalar setting and no entry of a list.

Source

pub fn scalar(&self, scalar: Scalar) -> &ScalarState

Where the scalar setting scalar ended up: its value and the rule that set it, or the rule that reset it.

Source

pub fn dxgi(&self) -> Option<Dxgi>

The DXGI-family implementation (see Rule::dxgi), None when no rule sets it.

Source

pub fn d3d9(&self) -> Option<D3d9>

The D3D9 implementation (see Rule::d3d9), None when no rule sets it.

Source

pub fn wined3d(&self) -> Option<Wined3d>

The renderer of wined3d (see Rule::wined3d), None when no rule sets it.

Source

pub fn opengl(&self) -> Option<OpenGl>

Which OpenGL the Mac driver gives (see Rule::opengl), None when no rule sets it.

Source

pub fn dpi_aware(&self) -> Option<bool>

The DPI awareness (see Rule::dpi_aware), None when no rule sets it.

Source

pub fn large_address_aware(&self) -> Option<bool>

Whether large address awareness is forced (see Rule::large_address_aware), None when no rule sets it.

Source

pub fn gcmouse(&self) -> Option<bool>

Whether mouse movement comes from GCMouse (see Rule::gcmouse), None when no rule sets it.

Source

pub fn force_nx(&self) -> Option<bool>

Whether no-execute stays on (see Rule::force_nx), None when no rule sets it.

Source

pub fn metal_hud(&self) -> Option<bool>

Whether the Metal performance HUD shows (see Rule::metal_hud), None when no rule sets it.

Source

pub fn d3d_config(&self) -> Option<&str>

The value the rules’ own env entries leave WINE_D3D_CONFIG at: the last entry for it, Some("") when that one removes it, and None when no rule sets it.

Source

pub fn fold_derived_env(&mut self)

Fold the settings that compatdb.so applies as environment entries into Resolution::env, each with the rule that set the setting as its origin and none of them a default:

  • Resolution::wined3d, when a rule sets it: the WINE_D3D_CONFIG that names the renderer, after the rules’ own entries. It is the value the variable ends up with, and it keeps the other options a rule’s WINE_D3D_CONFIG set (see runtime::wined3d_config). Unset, the process keeps whatever WINE_D3D_CONFIG it has, from a rule’s env or inherited, and without one wined3d uses OpenGL.
  • Resolution::metal_hud, when a rule sets it: the entries of metal_hud_env, which set or remove the MTL_HUD_ variables. They go where the rule that set it folded, before that rule’s own env entries, so an env entry for one of the variables from that rule or from any rule folded after it wins. Unset, the process keeps the ones it was started with.

Call it after Table::resolve, which records where each setting came from; a setting without that record adds nothing. A second call changes nothing.

Source

pub fn d3d_config_origin(&self) -> Option<&Origin>

Where the env entry that leaves WINE_D3D_CONFIG at Resolution::d3d_config came from, or None when no rule sets it.

Source

pub fn env_steps(&self, has: impl Fn(&str) -> bool) -> Vec<EnvStep>

The env entries in order, each with the rule that set it and whether it applies in a process where has says which variables the process already has. A default leaves such a variable alone, so a value the caller exported wins over a built-in * rule; every other entry applies, replacing the value or, when empty, removing the variable. An entry that a later applied entry for the same variable replaces says where that entry came from.

Resolution::env_from has one entry per env entry, as Table::resolve and Resolution::fold_derived_env keep it.

Trait Implementations§

Source§

impl Clone for Resolution

Source§

fn clone(&self) -> Resolution

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Resolution

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Resolution

Source§

fn default() -> Resolution

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

impl Eq for Resolution

Source§

impl PartialEq for Resolution

Source§

fn eq(&self, other: &Resolution) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Resolution

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.