返回 CodeWhale
constitution.rs
根目录 / crates / command-contract / src / constitution.rs
1 #[derive(Debug, Clone, Copy, PartialEq, Eq)]
2 pub enum ConstitutionLocale {
3 En,
4 ZhHans,
5 }
6
7 #[derive(Debug, Clone, Copy, PartialEq, Eq)]
8 pub enum ConstitutionAction {
9 OpenManager { review: bool },
10 OpenSetupConstitution,
11 OpenSetupPosture,
12 UseBundled,
13 PreviewEffectiveBasePrompt,
14 }
15
16 pub trait CommandConstitutionContext {
17 fn locale(&self) -> ConstitutionLocale;
18 fn open_pager(&mut self, title: &str, body: &str);
19 fn preview_text(&self) -> String;
20 fn repo_constitution_block(&self) -> Option<String>;
21 fn show_pending_suggestions(&mut self, title: &str);
22 fn ratify_clauses(&mut self, ids: &[&str]) -> String;
23 fn migrate(&self) -> String;
24 fn rollback(&self) -> String;
25 fn repair_text(&self) -> String;
26 }
27
27 lines RUST