pub struct WorktreeTemplateContext {
pub enabled: bool,
pub strategy: String,
pub layout_dir_name: String,
pub integration_mode: String,
pub default_branch: String,
pub project_root: String,
}Expand description
Context for rendering worktree-aware project templates.
This carries the resolved worktree configuration values. Templates use
these fields in {% if %} / {{ }} blocks to emit strategy-specific
instructions.
Fields§
§enabled: boolWhether worktrees are enabled.
strategy: StringStrategy name (e.g., "checkout_subdir", "checkout_siblings",
"bare_control_siblings"). Empty string when disabled.
layout_dir_name: StringDirectory name for worktree layouts (e.g., "ito-worktrees").
integration_mode: StringIntegration mode (e.g., "commit_pr", "merge_parent").
Empty string when disabled.
default_branch: StringDefault branch name (e.g., "main").
project_root: StringAbsolute path to the project root. Empty string when not resolved.
Trait Implementations§
Source§impl Clone for WorktreeTemplateContext
impl Clone for WorktreeTemplateContext
Source§fn clone(&self) -> WorktreeTemplateContext
fn clone(&self) -> WorktreeTemplateContext
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for WorktreeTemplateContext
impl Debug for WorktreeTemplateContext
Source§impl Default for WorktreeTemplateContext
impl Default for WorktreeTemplateContext
Source§fn default() -> Self
fn default() -> Self
Creates a WorktreeTemplateContext initialized with safe defaults for a disabled worktree setup.
Defaults:
enabled: falsestrategy: empty stringlayout_dir_name: “ito-worktrees”integration_mode: empty stringdefault_branch: “main”project_root: empty string
§Examples
use ito_templates::project_templates::WorktreeTemplateContext;
let ctx = WorktreeTemplateContext::default();
assert!(!ctx.enabled);
assert_eq!(ctx.layout_dir_name, "ito-worktrees");
assert_eq!(ctx.default_branch, "main");
assert!(ctx.project_root.is_empty());Auto Trait Implementations§
impl Freeze for WorktreeTemplateContext
impl RefUnwindSafe for WorktreeTemplateContext
impl Send for WorktreeTemplateContext
impl Sync for WorktreeTemplateContext
impl Unpin for WorktreeTemplateContext
impl UnwindSafe for WorktreeTemplateContext
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