Create a new `RegistryHelper`. # Arguments `config` - The string with registry configuration information. # Errors `RegistryError` - The error that occurred.
(key_path: &str, value_name: Option<String>, value_data: Option<RegistryValueData>)
| 57 | /// |
| 58 | /// * `RegistryError` - The error that occurred. |
| 59 | pub fn new(key_path: &str, value_name: Option<String>, value_data: Option<RegistryValueData>) -> Result<Self, RegistryError> { |
| 60 | let (hive, subkey) = get_hive_from_path(key_path)?; |
| 61 | let config = Registry { |
| 62 | key_path: key_path.to_string(), |
| 63 | value_name, |
| 64 | value_data, |
| 65 | metadata: None, |
| 66 | exist: None, |
| 67 | }; |
| 68 | Ok( |
| 69 | Self { |
| 70 | config, |
| 71 | hive, |
| 72 | subkey: subkey.to_string(), |
| 73 | what_if: false |
| 74 | } |
| 75 | ) |
| 76 | } |
| 77 | |
| 78 | pub fn enable_what_if(&mut self) { |
| 79 | self.what_if = true; |
nothing calls this directly
no test coverage detected