pub struct ConfigRegistry { /* private fields */ }
Expand description

The ConfigRegistry is used to create a registry, which allows reading and writing a configuration to and from a .config file as defined by a Kconfig file. To present the menu, a frontend is necessary to represent the state of the registry.

Implementations

Constructs a new configuration registry, given the Abstract syntax tree as loaded from a kconfig-parser’s Ast instance, and the macro symbols discoverd by the macro lexer (if used).

Retrieves the name of the main menu. This serves two purposes:

  1. It acquires the name for display in the User Interface
  2. It acquires a needle to find the underlying menu

Looks up an internal configuration item as mutable, boxed reference

Looks up an internal configuration as boxed referende

Looks an internal (sub)menu as mutable, boxed reference

Looks up an internal (sub)menu as boxed referende

Finds the prompt of the given configuration item. If no prompt is found, simply returns the content of the given configuration item name.

Returns the length of the children of the given (sub)menu

Returns the length of the children of the given (sub)menu which are enabled.

Returns if a menu item is enabled, given a descriptor of the menu item.

Returns and iterator of the descriptors of children of a menu item with the given menu name, which are enabled.

Returns the value as a string of the spefic menu item described by the descriptor.

Returns the menu item’s descriptor information, containing the Help text belonging to the given menu item indicated by the descriptor.

Mutates an item by stepping to the next value, this is used for values which can easily be toggled (such as a boolean configuration item).

Mutates an item by loading a string value into the configuration item. Only configuration items which support the ConfigMutationMode::ThroughString are capable of loading a configuration through a string.

Returns the mutation mode of a specific configuration item.

Returns the value of a specific configuration item.

Called from the user interface to notify a change should be propagated to all configuration items present.

Recursively gets a (sub)menu from the current menu element by looking up the menu by name

Checks if the given descriptor of the given (sub)menu is using the default value or not (where applicable).

Writes the current configuration known to the configuration registry into a file, typically this file has the file name “.config”

Writes the current configuration known to the configuration registry into a Write trait supporting type.

Reads the saved configuration from a file, typically this file has the file name “.config”, and mutates the configuration registry accordingly.

Reads the saved configuration from a Read trait supporting type, and mutates the configuration registry accordingly.

Trait Implementations

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

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.