pub struct ConfigService;Expand description
配置导入导出相关业务逻辑
Implementations§
Source§impl ConfigService
impl ConfigService
Sourcepub fn create_backup(
config_path: &Path,
custom_name: Option<String>,
) -> Result<String, AppError>
pub fn create_backup( config_path: &Path, custom_name: Option<String>, ) -> Result<String, AppError>
Sourcepub fn restore_from_backup_id(
backup_id: &str,
state: &AppState,
) -> Result<String, AppError>
pub fn restore_from_backup_id( backup_id: &str, state: &AppState, ) -> Result<String, AppError>
根据备份 ID 恢复配置
Sourcepub fn export_config_to_path(target_path: &Path) -> Result<(), AppError>
pub fn export_config_to_path(target_path: &Path) -> Result<(), AppError>
将当前 config.json 拷贝到目标路径。
pub fn import_config_from_path( file_path: &Path, state: &AppState, ) -> Result<String, AppError>
Sourcepub fn sync_current_providers_to_live(
config: &mut MultiAppConfig,
) -> Result<(), AppError>
pub fn sync_current_providers_to_live( config: &mut MultiAppConfig, ) -> Result<(), AppError>
同步当前供应商到对应的 live 配置。
Auto Trait Implementations§
impl Freeze for ConfigService
impl RefUnwindSafe for ConfigService
impl Send for ConfigService
impl Sync for ConfigService
impl Unpin for ConfigService
impl UnsafeUnpin for ConfigService
impl UnwindSafe for ConfigService
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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