pub struct Config {
pub default_service: AIService,
pub services: Vec<AIServiceConfig>,
pub ai_review: bool,
pub timeout_seconds: u64,
pub max_tokens: u64,
pub gerrit: Option<GerritConfig>,
pub only_chinese: bool,
pub only_english: bool,
pub translate_direction: TranslateDirection,
}Fields§
§default_service: AIService§services: Vec<AIServiceConfig>§ai_review: bool§timeout_seconds: u64§max_tokens: u64§gerrit: Option<GerritConfig>§only_chinese: bool§only_english: bool§translate_direction: TranslateDirectionImplementations§
Source§impl Config
impl Config
pub fn new() -> Self
pub fn load() -> Result<Self>
pub async fn interactive_config() -> Result<()>
pub async fn setup_gerrit(&mut self) -> Result<()>
pub async fn interactive_config_impl() -> Result<()>
pub async fn add_service(&mut self, service: AIService) -> Result<()>
pub async fn edit_service(&mut self) -> Result<()>
pub async fn remove_service(&mut self) -> Result<()>
pub async fn set_default_service(&mut self) -> Result<()>
pub async fn input_service_config(service: AIService) -> Result<AIServiceConfig>
pub async fn input_service_config_with_default( default: &AIServiceConfig, ) -> Result<AIServiceConfig>
pub fn get_default_service(&self) -> Result<&AIServiceConfig>
pub fn save(&self) -> Result<()>
pub fn config_path() -> Result<PathBuf>
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