pub struct TimerConfig {
pub wheel: WheelConfig,
pub service: ServiceConfig,
pub batch: BatchConfig,
}Expand description
顶层定时器配置
组合所有子配置,提供完整的定时器系统配置。
§示例
use kestrel_protocol_timer::TimerConfig;
// 使用默认配置
let config = TimerConfig::default();
// 使用 Builder 自定义配置(仅配置服务参数)
let config = TimerConfig::builder()
.command_channel_capacity(1024)
.timeout_channel_capacity(2000)
.build()
.unwrap();Fields§
§wheel: WheelConfig时间轮配置
service: ServiceConfig服务配置
batch: BatchConfig批处理配置
Implementations§
Source§impl TimerConfig
impl TimerConfig
Sourcepub fn builder() -> TimerConfigBuilder
pub fn builder() -> TimerConfigBuilder
创建配置构建器
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