Skip to main content

SettingsFile

Struct SettingsFile 

Source
pub struct SettingsFile { /* private fields */ }

Implementations§

Source§

impl SettingsFile

Source

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

Source

pub fn web_board(&self, id: &str) -> Option<Map<String, Value>>

Raw native entry, including source provenance and unknown fields.

Source

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.

Source

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

Source

pub fn open(file: &Path) -> Result<Self, SettingsError>

Opens the config file for editing. Settings saved under a Space’s former id are read, and later saved, as the Space’s own (see crate::former_ids).

Source

pub fn values(&self) -> &ServiceSettings

Source

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.

Source

pub fn board_file_values(&self, id: &str) -> Map<String, Value>

The saved settings of native board id’s opened file.

Source

pub fn board_values(&self, section: &[String]) -> Map<String, Value>

The saved values of the board whose config section is section.

Source

pub fn board_secret_present(&self, section: &[String], key: &str) -> bool

Whether the board at section has a saved secret key.

Source

pub fn board_secret_keys(&self, section: &[String]) -> Vec<String>

The keys of the secrets saved for the board at section, never their values.

Source

pub fn board_permission(&self, section: &[String], key: &str) -> bool

Source

pub fn token_present(&self, section: &str) -> bool

Source

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.

Source

pub fn save_board_order( &mut self, order: &[String], ) -> Result<(), SettingsError>

Persist the switcher order without changing other settings.

Source

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.

Auto Trait Implementations§

§

impl Forget for SettingsFile

§

impl Freeze for SettingsFile
where *const u8 is !null: Freeze, PhantomData<u8>: Freeze, *const LeafNode<String, Value> is !null: Freeze, PhantomData<(Owned, LeafOrInternal)>: Freeze, PhantomData<Box<(String, Value)>>: Freeze, *const LeafNode<String, bool> is !null: Freeze, PhantomData<Box<(String, bool)>>: Freeze, PhantomData<String>: Freeze, PhantomData<BoardFieldEdits>: Freeze, *const LeafNode<String, Map<String, Value>> is !null: Freeze, PhantomData<Box<(String, Map<String, Value>)>>: Freeze, *const LeafNode<String, BoardFile> is !null: Freeze, PhantomData<Box<(String, BoardFile)>>: Freeze, *const LeafNode<String, String> is !null: Freeze, PhantomData<Box<(String, String)>>: Freeze,

§

impl Move for SettingsFile

§

impl RefUnwindSafe for SettingsFile

§

impl Send for SettingsFile
where RawVecInner: Send, NodeRef<Owned, String, Value, LeafOrInternal>: Send, BoxRaw<(String, Value)>: Send, NodeRef<Owned, String, bool, LeafOrInternal>: Send, BoxRaw<(String, bool)>: Send, NodeRef<Owned, String, Option<Value>, LeafOrInternal>: Send, BoxRaw<(String, Option<Value>)>: Send, NodeRef<Owned, String, TokenEdit, LeafOrInternal>: Send, BoxRaw<(String, TokenEdit)>: Send, NodeRef<Owned, String, Map<String, Value>, LeafOrInternal>: Send, BoxRaw<(String, Map<String, Value>)>: Send, NodeRef<Owned, String, BoardFile, LeafOrInternal>: Send, BoxRaw<(String, BoardFile)>: Send, NodeRef<Owned, String, String, LeafOrInternal>: Send, BoxRaw<(String, String)>: Send,

§

impl Sync for SettingsFile
where RawVecInner: Sync, NodeRef<Owned, String, Value, LeafOrInternal>: Sync, BoxRaw<(String, Value)>: Sync, NodeRef<Owned, String, bool, LeafOrInternal>: Sync, BoxRaw<(String, bool)>: Sync, NodeRef<Owned, String, Option<Value>, LeafOrInternal>: Sync, BoxRaw<(String, Option<Value>)>: Sync, NodeRef<Owned, String, TokenEdit, LeafOrInternal>: Sync, BoxRaw<(String, TokenEdit)>: Sync, NodeRef<Owned, String, Map<String, Value>, LeafOrInternal>: Sync, BoxRaw<(String, Map<String, Value>)>: Sync, NodeRef<Owned, String, BoardFile, LeafOrInternal>: Sync, BoxRaw<(String, BoardFile)>: Sync, NodeRef<Owned, String, String, LeafOrInternal>: Sync, BoxRaw<(String, String)>: Sync,

§

impl Unpin for SettingsFile
where *const u8 is !null: Unpin, *const LeafNode<String, Value> is !null: Unpin, Box<(String, Value)>: Unpin, *const LeafNode<String, bool> is !null: Unpin, Box<(String, bool)>: Unpin, *const LeafNode<String, Option<Value>> is !null: Unpin, Box<(String, Option<Value>)>: Unpin, *const LeafNode<String, TokenEdit> is !null: Unpin, Box<(String, TokenEdit)>: Unpin, *const LeafNode<String, Map<String, Value>> is !null: Unpin, Box<(String, Map<String, Value>)>: Unpin, *const LeafNode<String, BoardFile> is !null: Unpin, Box<(String, BoardFile)>: Unpin, *const LeafNode<String, String> is !null: Unpin, Box<(String, String)>: Unpin,

§

impl UnsafeUnpin for SettingsFile

§

impl UnwindSafe for SettingsFile

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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

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.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more