pub struct ThemeStorage;Expand description
Theme storage manager for persisting theme preferences and custom themes
Implementations§
Source§impl ThemeStorage
impl ThemeStorage
Sourcepub fn themes_directory() -> StorageResult<PathBuf>
pub fn themes_directory() -> StorageResult<PathBuf>
Get the themes directory path
Returns ~/.ricecoder/themes/ or the configured themes directory
Sourcepub fn preference_file() -> StorageResult<PathBuf>
pub fn preference_file() -> StorageResult<PathBuf>
Get the theme preference file path
Returns ~/.ricecoder/theme.yaml
Sourcepub fn load_preference() -> StorageResult<ThemePreference>
pub fn load_preference() -> StorageResult<ThemePreference>
Load theme preference from storage
Returns the saved theme preference or default if not found
Sourcepub fn save_preference(preference: &ThemePreference) -> StorageResult<()>
pub fn save_preference(preference: &ThemePreference) -> StorageResult<()>
Save theme preference to storage
Creates the .ricecoder/ directory if it doesn’t exist
Sourcepub fn save_custom_theme(
theme_name: &str,
content: &str,
) -> StorageResult<PathBuf>
pub fn save_custom_theme( theme_name: &str, content: &str, ) -> StorageResult<PathBuf>
Save a custom theme file
Saves the theme YAML content to ~/.ricecoder/themes/{theme_name}.yaml
Sourcepub fn load_custom_theme(theme_name: &str) -> StorageResult<String>
pub fn load_custom_theme(theme_name: &str) -> StorageResult<String>
Load a custom theme file
Loads the theme YAML content from ~/.ricecoder/themes/{theme_name}.yaml
Sourcepub fn delete_custom_theme(theme_name: &str) -> StorageResult<()>
pub fn delete_custom_theme(theme_name: &str) -> StorageResult<()>
Delete a custom theme file
Sourcepub fn list_custom_themes() -> StorageResult<Vec<String>>
pub fn list_custom_themes() -> StorageResult<Vec<String>>
List all custom theme files
Sourcepub fn custom_theme_exists(theme_name: &str) -> StorageResult<bool>
pub fn custom_theme_exists(theme_name: &str) -> StorageResult<bool>
Check if a custom theme exists
Auto Trait Implementations§
impl Freeze for ThemeStorage
impl RefUnwindSafe for ThemeStorage
impl Send for ThemeStorage
impl Sync for ThemeStorage
impl Unpin for ThemeStorage
impl UnwindSafe for ThemeStorage
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
Mutably borrows from an owned value. Read more