Skip to main content

Key

Enum Key 

Source
#[non_exhaustive]
pub enum Key {
Show 18 variants Exe, Company, Product, OriginalFilename, Dxgi, D3d9, Wined3d, OpenGl, DpiAware, LargeAddressAware, Gcmouse, ForceNx, MetalHud, DllOverrides, ArgumentsOverride, Arguments, DebugChannels, Env,
}
Expand description

The key of a field of a rule, which is also the name of the field on the wire.

Each variant says what the field does and what a process gets without it; the getter of Rule it links to has the details. The text compatdb.so logs for an unset setting is Key::upstream.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Exe

The image basename a rule matches, in any case, or * for every process.

exe, see Exe. Every rule has one.

§

Company

A text the company name of the image’s version resource must contain.

company, a substring of the version string CompanyName, compared ASCII-case-insensitively (see Rule::company). Without it, any company matches.

§

Product

A text the product name of the image’s version resource must contain.

product, a substring of the version string ProductName, compared ASCII-case-insensitively (see Rule::product). Without it, any product matches.

§

OriginalFilename

A text the original file name of the image’s version resource must contain.

original_filename, a substring of the version string OriginalFilename, compared ASCII-case-insensitively (see Rule::original_filename). Without it, any original filename matches.

§

Dxgi

The implementation of D3D10 to D3D12 the process loads.

dxgi, a Dxgi (see Rule::dxgi). Unset: wined3d, as in upstream Wine.

§

D3d9

The D3D9 implementation the process loads.

d3d9, a D3d9 (see Rule::d3d9). Unset: wined3d, as in upstream Wine.

§

Wined3d

The renderer wined3d draws with in the process.

wined3d, a Wined3d for the whole process (see Rule::wined3d). Unset: WINE_D3D_CONFIG or wined3d’s registry settings decide, and without them OpenGL.

§

OpenGl

Which OpenGL the Mac driver gives the process.

opengl, an OpenGl (see Rule::opengl). Unset: Apple’s OpenGL, as in upstream Wine.

§

DpiAware

Whether the process is DPI-aware.

dpi_aware (see Rule::dpi_aware). Unset: the registry and the manifest decide, and without them the process is unaware.

§

LargeAddressAware

Whether a 32-bit process gets the 4 GB address space whatever its executable’s flag says.

large_address_aware (see Rule::large_address_aware). Unset: the flag decides.

§

Gcmouse

Whether raw mouse movement comes from GameController instead of the cursor.

gcmouse (see Rule::gcmouse). Unset: from the cursor, as in upstream Wine.

§

ForceNx

Whether no-execute stays on in a 32-bit process.

force_nx (see Rule::force_nx). Unset: Wine turns it off for an image without NX_COMPAT.

§

MetalHud

Whether the Metal performance HUD shows.

metal_hud, through the variables of metal_hud_env (see Rule::metal_hud). Unset: the process keeps the variables it was started with.

§

DllOverrides

DLL load-order overrides, one WINEDLLOVERRIDES element each.

dll_overrides, repeatable (see Rule::dll_overrides). None: WINEDLLOVERRIDES and the registry decide.

§

ArgumentsOverride

Arguments that replace those the rules folded before give the command line.

arguments_override, repeatable (see Rule::arguments_override). None: the arguments of every rule append.

§

Arguments

Text appended to the command line, one argument string each.

arguments, repeatable (see Rule::arguments). None: the command line stays as it was.

§

DebugChannels

WINEDEBUG channels for the process, one entry each.

debug_channels, repeatable (see Rule::debug_channels). Wine reads WINEDEBUG before compatdb.so loads, so the library only logs them; a launcher puts them into the variable (see Table::winedebug). None: the WINEDEBUG the process was started with.

§

Env

Environment variables the process gets; an empty value removes the variable.

env, one NAME=value entry each, repeatable (see Rule::env). None: the environment the process was started with.

Implementations§

Source§

impl Key

Source

pub const fn docs_url(self) -> &'static str

The full URL of this key’s doc, the doc of its variant of Key.

Source§

impl Key

Source

pub const ALL: &'static [Self]

Every key, in the order a record writes its fields.

Source

pub const fn as_str(self) -> &'static str

The key as the wire writes it, in lowercase.

Source

pub const fn scalar(self) -> Option<Scalar>

The scalar setting this key names, or None for a matcher or a list.

Source

pub const fn kind(self) -> KeyKind

What kind of field this key names.

Source

pub const fn label(self) -> &'static str

How a launcher names the field to a person, for example DPI-aware.

Source

pub const fn upstream(self) -> Option<&'static str>

What upstream Wine does for this setting when no rule sets it, as the log of compatdb.so prints it, or None for a matcher. arguments_override is a way of setting the arguments, so it shares their text.

Source

pub const fn values(self) -> &'static [&'static str]

The spellings the value of a scalar setting can have, in lowercase, default included; empty for any other key, whose values are user data.

Source

pub const fn summary(self) -> &'static str

What the field does, in one line of plain text without markup, such as a launcher’s template puts above the setting. It is the first paragraph of the key’s doc, which Key::docs_url links to.

Source

pub const fn example(self) -> &'static str

A value a launcher’s template can show for the field, as Rule::set takes it: a matcher’s value, one of Key::values other than default for a scalar setting, one entry for a list, and NAME=value for env. A launcher that writes env as a table of names splits it at the first =.

The exe is a program’s, not *, since arguments_override needs one; every example is a value a rule for that program takes.

Source§

impl Key

Source

pub fn from_setting(name: &str) -> Result<Self, FieldError>

The key a launcher’s setting called name names, compared ASCII-case-insensitively as str::parse compares it, which this is but for the keys that are no longer read.

dxgi and DXGI therefore name the same key: a launcher that hands both to Rule::set gets the value of the last one for a matcher or a scalar, and the entries of both for a list.

§Errors

FieldError::RetiredKey for a key that is no longer read, with its severity: x87_sidecar is a warning, since it asks for nothing this Wine could still do, and cmdline_append, which arguments replaced, an error. FieldError::UnknownKey for any other name that is no key.

Source

pub const fn allowed_on_any(self) -> bool

Whether a rule for every process, one whose exe is * (Exe::Any) with or without a fingerprint, may hold this setting.

It may hold every scalar setting, every list and env, but not arguments_override: for every process that would take away the arguments the built-in rules give single programs. A matcher is not a setting, so this is false for one: exe decides whether the rule is for every process at all, and a fingerprint narrows the processes it matches, so neither belongs among the settings a launcher offers for every process.

Rule::set and Rule::set_list refuse a setting for which this is false in a * rule, and an exe of * in a rule that holds one, with FieldError::ArgumentsOverrideOnAny.

Source

pub const fn replaces_on_merge(self) -> bool

Whether a later layer’s value for this key takes the place of an earlier layer’s, rather than adding to it, when a launcher builds one rule from several layers of its configuration, such as a file of defaults and a file per game laid over it.

  • A matcher or a scalar setting holds one value, so the later layer’s replaces it: true.
  • A list adds the later layer’s entries after the earlier layer’s: false.
  • arguments_override is the exception among the lists: true. A rule has one override, the whole list that replaces the arguments of the rules folded before it (see Rule::arguments_override). The entries of two layers added together would be an override neither layer wrote, and an empty list in the later layer has to clear an earlier layer’s override, as arguments_override= alone clears the arguments on the wire.
  • env adds the later layer’s entries: false. The entries fold in order, so a later entry for the same variable wins.

This is only about layers of one rule. Between rules nothing replaces: every rule that matches a process applies, in the order Table::resolve folds them.

Trait Implementations§

Source§

impl Clone for Key

Source§

fn clone(&self) -> Key

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 Copy for Key

Source§

impl Debug for Key

Source§

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

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

impl Display for Key

Source§

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

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

impl Eq for Key

Source§

impl FromStr for Key

Source§

fn from_str(s: &str) -> Result<Self, Self::Err>

The key spelled s, compared ASCII-case-insensitively.

Source§

type Err = FieldError

The associated error which can be returned from parsing.
Source§

impl Hash for Key

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl Ord for Key

Source§

fn cmp(&self, other: &Key) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 (const: unstable) · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 (const: unstable) · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

impl PartialEq for Key

Source§

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

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

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

Inequality operator !=. Read more
Source§

impl PartialOrd for Key

Source§

fn partial_cmp(&self, other: &Key) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 (const: unstable) · Source§

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

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 (const: unstable) · Source§

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

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 (const: unstable) · Source§

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

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 (const: unstable) · Source§

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

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl StructuralPartialEq for Key

Auto Trait Implementations§

§

impl Freeze for Key

§

impl RefUnwindSafe for Key

§

impl Send for Key

§

impl Sync for Key

§

impl Unpin for Key

§

impl UnsafeUnpin for Key

§

impl UnwindSafe for Key

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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. 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.