Return a vector of [ModifiedParameter] instances that need to be pushed to the backend and reset this set to the empty set for future calls. The set will start growing again as soon as we modify a parameter from the `synchronized` set with a [SynchronizedParameters::modify] call.
(&mut self)
| 66 | /// The set will start growing again as soon as we modify a parameter from |
| 67 | /// the `synchronized` set with a [SynchronizedParameters::modify] call. |
| 68 | pub fn modified(&mut self) -> Vec<ModifiedParameter> { |
| 69 | let mut modified = BTreeSet::new(); |
| 70 | std::mem::swap(&mut self.modified, &mut modified); |
| 71 | self.system_vars |
| 72 | .iter_synced() |
| 73 | .filter(move |var| modified.contains(var.name())) |
| 74 | .map(|var| { |
| 75 | let name = var.name().to_string(); |
| 76 | let value = var.value(); |
| 77 | let is_default = self.system_vars.is_default(&name, VarInput::Flat(&value)).expect("This will never panic because both the name and the value come from a `Var` instance"); |
| 78 | ModifiedParameter { |
| 79 | name, |
| 80 | value, |
| 81 | is_default, |
| 82 | } |
| 83 | }) |
| 84 | .collect() |
| 85 | } |
| 86 | |
| 87 | /// Get the current in-memory value for the parameter identified by the |
| 88 | /// given `name`. |
no test coverage detected