pub struct Config {
pub day_start_minutes: u16,
pub keys: KeyMap,
pub categories: CategoryTheme,
}Fields§
§day_start_minutes: u16§keys: KeyMap§categories: CategoryThemeImplementations§
Source§impl Config
impl Config
pub fn category_color(&self, cat: Category) -> Color
pub fn category_name(&self, cat: Category) -> String
Source§impl Config
impl Config
pub fn from_toml_str(s: &str) -> Result<Self>
pub fn load() -> Self
Sourcepub fn default_toml() -> String
pub fn default_toml() -> String
Render a default TOML string users can customize.
Sourcepub fn write_default_file() -> Result<PathBuf>
pub fn write_default_file() -> Result<PathBuf>
Write a default config file to the resolved path.
- If
CHUTE_KUN_CONFIGis set, writes there; otherwise XDG default. - Creates parent directories when必要.
- If file already exists, leaves it as-is and returns Ok(path).
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 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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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