pub struct TimerConfig {
pub wheel: WheelConfig,
pub service: ServiceConfig,
pub batch: BatchConfig,
}Expand description
顶层定时器配置 (Top-level Timer Configuration)
组合所有子配置,提供完整的定时器系统配置。 (Combines all sub-configurations to provide complete timer system configuration)
§示例 (Examples)
use kestrel_timer::TimerConfig;
// 使用默认配置 (Use default configuration)
let config = TimerConfig::default();
// 使用 Builder 自定义配置(仅配置服务参数)(Use Builder to customize configuration, service parameters only)
let config = TimerConfig::builder()
.command_channel_capacity(1024)
.timeout_channel_capacity(2000)
.build()
.unwrap();Fields§
§wheel: WheelConfig时间轮配置 (Timing wheel configuration)
service: ServiceConfig服务配置 (Service configuration)
batch: BatchConfig批处理配置 (Batch processing configuration)
Implementations§
Source§impl TimerConfig
impl TimerConfig
Sourcepub fn builder() -> TimerConfigBuilder
pub fn builder() -> TimerConfigBuilder
创建配置构建器 (Create configuration builder)
Trait Implementations§
Source§impl Clone for TimerConfig
impl Clone for TimerConfig
Source§fn clone(&self) -> TimerConfig
fn clone(&self) -> TimerConfig
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 TimerConfig
impl Debug for TimerConfig
Auto Trait Implementations§
impl Freeze for TimerConfig
impl RefUnwindSafe for TimerConfig
impl Send for TimerConfig
impl Sync for TimerConfig
impl Unpin for TimerConfig
impl UnwindSafe for TimerConfig
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