pub struct Config {
pub editor: EditorConfig,
pub open: OpenConfig,
pub hooks: HooksConfig,
pub workspace: WorkspaceConfig,
}Expand description
Top-level configuration for the worktree CLI.
Fields§
§editor: EditorConfigEditor configuration.
open: OpenConfigWorkspace open behavior.
hooks: HooksConfigHook scripts run around the open command.
workspace: WorkspaceConfigWorkspace lifecycle configuration.
Implementations§
Source§impl Config
impl Config
Sourcepub fn path() -> Result<PathBuf>
pub fn path() -> Result<PathBuf>
Return the path to the config file (~/.config/worktree/config.toml).
§Errors
Returns an error if the home directory cannot be determined.
Source§impl Config
impl Config
Source§impl Config
impl Config
Sourcepub fn to_toml_with_comments(&self) -> String
pub fn to_toml_with_comments(&self) -> String
Serialize the config to a TOML string with inline documentation comments.
Each section header and field is preceded by a # comment that matches
the doc-comment on the corresponding struct field. The resulting string
round-trips cleanly through toml::from_str.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Config
impl<'de> Deserialize<'de> for Config
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
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
Mutably borrows from an owned value. Read more