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 new() -> HotReloadConfig
pub fn new() -> HotReloadConfig
创建新配置
Sourcepub fn with_strategy(self, strategy: ReloadStrategy) -> HotReloadConfig
pub fn with_strategy(self, strategy: ReloadStrategy) -> HotReloadConfig
设置热加载策略
Sourcepub fn with_preserve_state(self, preserve: bool) -> HotReloadConfig
pub fn with_preserve_state(self, preserve: bool) -> HotReloadConfig
设置是否保存状态
Sourcepub fn with_auto_rollback(self, auto_rollback: bool) -> HotReloadConfig
pub fn with_auto_rollback(self, auto_rollback: bool) -> HotReloadConfig
设置是否自动回滚
Sourcepub fn with_max_attempts(self, max_attempts: u32) -> HotReloadConfig
pub fn with_max_attempts(self, max_attempts: u32) -> HotReloadConfig
设置最大尝试次数
Sourcepub fn with_reload_cooldown(self, cooldown: Duration) -> HotReloadConfig
pub fn with_reload_cooldown(self, cooldown: Duration) -> HotReloadConfig
设置热加载间隔
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
Source§impl Default for HotReloadConfig
impl Default for HotReloadConfig
Source§fn default() -> HotReloadConfig
fn default() -> HotReloadConfig
Returns the “default value” for a type. Read more
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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 moreSource§impl<T> Message for T
impl<T> Message for T
Source§fn from_boxed(m: BoxedMessage) -> Result<Self, BoxedDowncastErr>
fn from_boxed(m: BoxedMessage) -> Result<Self, BoxedDowncastErr>
Convert a BoxedMessage to this concrete type
Source§fn box_message(self, pid: &ActorId) -> Result<BoxedMessage, BoxedDowncastErr>
fn box_message(self, pid: &ActorId) -> Result<BoxedMessage, BoxedDowncastErr>
Convert this message to a BoxedMessage