pub struct PresetManager { /* private fields */ }Expand description
Preset manager for loading and managing presets.
Implementations§
Source§impl PresetManager
impl PresetManager
Sourcepub fn with_custom_dir<P: AsRef<Path>>(custom_dir: P) -> Result<Self>
pub fn with_custom_dir<P: AsRef<Path>>(custom_dir: P) -> Result<Self>
Create a preset manager with custom preset directory.
Sourcepub fn get_preset(&self, name: &str) -> Result<&Preset>
pub fn get_preset(&self, name: &str) -> Result<&Preset>
Get a preset by name.
Sourcepub fn list_presets(&self) -> Vec<&Preset>
pub fn list_presets(&self) -> Vec<&Preset>
List all presets.
Sourcepub fn list_presets_by_category(&self, category: PresetCategory) -> Vec<&Preset>
pub fn list_presets_by_category(&self, category: PresetCategory) -> Vec<&Preset>
List presets by category.
Sourcepub fn preset_names(&self) -> Vec<String>
pub fn preset_names(&self) -> Vec<String>
Get all available preset names.
Sourcepub fn has_preset(&self, name: &str) -> bool
pub fn has_preset(&self, name: &str) -> bool
Check if a preset exists.
Sourcepub fn add_preset(&mut self, preset: Preset) -> Result<()>
pub fn add_preset(&mut self, preset: Preset) -> Result<()>
Add a custom preset.
Sourcepub fn save_preset(&self, name: &str) -> Result<()>
pub fn save_preset(&self, name: &str) -> Result<()>
Save a custom preset to file.
Sourcepub fn remove_preset(&mut self, name: &str) -> Result<()>
pub fn remove_preset(&mut self, name: &str) -> Result<()>
Remove a custom preset.
Sourcepub fn default_custom_dir() -> Result<PathBuf>
pub fn default_custom_dir() -> Result<PathBuf>
Get default custom preset directory.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PresetManager
impl RefUnwindSafe for PresetManager
impl Send for PresetManager
impl Sync for PresetManager
impl Unpin for PresetManager
impl UnsafeUnpin for PresetManager
impl UnwindSafe for PresetManager
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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>
Converts
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>
Converts
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