pub struct HotReloadConfig {
pub strategy: ReloadStrategy,
pub preserve_state: bool,
pub auto_rollback: bool,
pub max_reload_attempts: u32,
pub reload_cooldown: Duration,
}Expand description
热加载配置
Fields§
§strategy: ReloadStrategy热加载策略
preserve_state: bool是否保存状态
auto_rollback: bool自动回滚失败的热加载
max_reload_attempts: u32最大热加载尝试次数
reload_cooldown: Duration热加载尝试间隔
Implementations§
Source§impl HotReloadConfig
impl HotReloadConfig
Sourcepub fn with_strategy(self, strategy: ReloadStrategy) -> Self
pub fn with_strategy(self, strategy: ReloadStrategy) -> Self
设置热加载策略
Sourcepub fn with_preserve_state(self, preserve: bool) -> Self
pub fn with_preserve_state(self, preserve: bool) -> Self
设置是否保存状态
Sourcepub fn with_auto_rollback(self, auto_rollback: bool) -> Self
pub fn with_auto_rollback(self, auto_rollback: bool) -> Self
设置是否自动回滚
Sourcepub fn with_max_attempts(self, max_attempts: u32) -> Self
pub fn with_max_attempts(self, max_attempts: u32) -> Self
设置最大尝试次数
Sourcepub fn with_reload_cooldown(self, cooldown: Duration) -> Self
pub fn with_reload_cooldown(self, cooldown: Duration) -> Self
设置热加载间隔
Trait Implementations§
Source§impl Clone for HotReloadConfig
impl Clone for HotReloadConfig
Source§fn clone(&self) -> HotReloadConfig
fn clone(&self) -> HotReloadConfig
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 HotReloadConfig
impl Debug for HotReloadConfig
Auto Trait Implementations§
impl Freeze for HotReloadConfig
impl RefUnwindSafe for HotReloadConfig
impl Send for HotReloadConfig
impl Sync for HotReloadConfig
impl Unpin for HotReloadConfig
impl UnsafeUnpin for HotReloadConfig
impl UnwindSafe for HotReloadConfig
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