pub struct Config {
pub data: ConfigData,
pub config_file: PathBuf,
}Expand description
Persistent config container wrapping loaded schema and file source info.
Fields§
§data: ConfigDataActive live configuration switches.
config_file: PathBufPath to config file source.
Implementations§
Source§impl Config
impl Config
Sourcepub fn new() -> Self
pub fn new() -> Self
Load the config from the standard Mimick config path, creating a default file if missing.
Sourcepub fn get_api_key(&self) -> Option<String>
pub fn get_api_key(&self) -> Option<String>
Look up the API key from the desktop keyring via oo7.
Automatically selects the correct backend:
- Flatpak sandbox: encrypted file via the Secret portal
- Native: D-Bus Secret Service (GNOME Keyring, KWallet)
When the portal is unavailable (common on Hyprland, Sway, XFCE), falls back to the D-Bus Secret Service before giving up.
Sourcepub fn set_api_key(&self, key: &str) -> Result<(), String>
pub fn set_api_key(&self, key: &str) -> Result<(), String>
Store the API key in the desktop keyring via oo7.
Returns Ok(()) on success. On failure, returns an error string
with user-facing guidance tailored to the specific keyring backend
that failed (portal misconfiguration, missing D-Bus service, etc.).
Sourcepub fn watch_path_strings(&self) -> Vec<String>
pub fn watch_path_strings(&self) -> Vec<String>
Return all configured watch paths as plain strings for the live monitor.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnsafeUnpin for Config
impl UnwindSafe for Config
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more