pub struct SettingsFile { /* private fields */ }Implementations§
Source§impl SettingsFile
impl SettingsFile
Sourcepub fn update_repos(&mut self, repos: &[String]) -> Result<(), SettingsError>
pub fn update_repos(&mut self, repos: &[String]) -> Result<(), SettingsError>
Immediately writes repos as the saved list, in order. Every other
value and unknown key in the file is kept, and the file stays
owner-only. A file changed since it was opened is refused as stale.
Source§impl SettingsFile
impl SettingsFile
Sourcepub fn web_board(&self, id: &str) -> Option<Map<String, Value>>
pub fn web_board(&self, id: &str) -> Option<Map<String, Value>>
Raw native entry, including source provenance and unknown fields.
Sourcepub fn update_web_board(
&mut self,
id: &str,
entry: Option<Map<String, Value>>,
) -> Result<(), SettingsError>
pub fn update_web_board( &mut self, id: &str, entry: Option<Map<String, Value>>, ) -> Result<(), SettingsError>
Immediately writes one complete entry, or unregisters it when absent. The caller supplies the full raw entry to retain its existing fields. Board enablement, ordering, other entries and unrelated JSON are untouched.
Sourcepub fn rebase_web_boards(&mut self) -> Result<(), SettingsError>
pub fn rebase_web_boards(&mut self) -> Result<(), SettingsError>
Accepts immediate webBoards changes without accepting unrelated edits.
The caller retains its draft inputs. A conflict leaves this snapshot intact.
Source§impl SettingsFile
impl SettingsFile
pub fn open(file: &Path) -> Result<Self, SettingsError>
pub fn values(&self) -> &ServiceSettings
Sourcepub fn open_board_file(
&mut self,
id: &str,
) -> Result<Map<String, Value>, SettingsError>
pub fn open_board_file( &mut self, id: &str, ) -> Result<Map<String, Value>, SettingsError>
Opens native board id’s own settings file for this transaction, once,
and returns its saved settings. A missing file has none.
Sourcepub fn board_file_values(&self, id: &str) -> Map<String, Value>
pub fn board_file_values(&self, id: &str) -> Map<String, Value>
The saved settings of native board id’s opened file.
Sourcepub fn board_values(&self, section: &[String]) -> Map<String, Value>
pub fn board_values(&self, section: &[String]) -> Map<String, Value>
The saved values of the board whose config section is section.
Sourcepub fn board_secret_present(&self, section: &[String], key: &str) -> bool
pub fn board_secret_present(&self, section: &[String], key: &str) -> bool
Whether the board at section has a saved secret key.
Sourcepub fn board_secret_keys(&self, section: &[String]) -> Vec<String>
pub fn board_secret_keys(&self, section: &[String]) -> Vec<String>
The keys of the secrets saved for the board at section, never
their values.
pub fn board_permission(&self, section: &[String], key: &str) -> bool
pub fn token_present(&self, section: &str) -> bool
Sourcepub fn save(&mut self, values: &ServiceSettings) -> Result<(), SettingsError>
pub fn save(&mut self, values: &ServiceSettings) -> Result<(), SettingsError>
Writes the config file, then each changed board file. Every file is checked before the first write, so a conflict writes nothing.
Sourcepub fn save_board_order(
&mut self,
order: &[String],
) -> Result<(), SettingsError>
pub fn save_board_order( &mut self, order: &[String], ) -> Result<(), SettingsError>
Persist the switcher order without changing other settings.
Sourcepub fn save_board_choices(
&mut self,
boards: &BTreeMap<String, bool>,
) -> Result<(), SettingsError>
pub fn save_board_choices( &mut self, boards: &BTreeMap<String, bool>, ) -> Result<(), SettingsError>
Persist the board choices (boards) without changing other settings,
as Save writes them: a missing id uses the product default.