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::config::TimerConfig;
use std::num::NonZeroUsize;
// Use default configuration (使用默认配置)
let config = TimerConfig::default();
// Use Builder to customize configuration, service parameters only
// (使用 Builder 自定义配置,仅配置服务参数)
let config = TimerConfig::builder()
.command_channel_capacity(NonZeroUsize::new(1024).unwrap())
.timeout_channel_capacity(NonZeroUsize::new(2000).unwrap())
.build();Fields§
§wheel: WheelConfigTiming wheel configuration
service: ServiceConfigService configuration
batch: BatchConfigBatch 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
Source§impl Default for TimerConfig
impl Default for TimerConfig
Source§fn default() -> TimerConfig
fn default() -> TimerConfig
Returns the “default value” for a type. Read more
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