pub struct ServiceConfig {
pub command_channel_capacity: NonZeroUsize,
pub timeout_channel_capacity: NonZeroUsize,
}Expand description
Service Configuration
Used to configure channel capacities for TimerService.
§服务配置
用于配置 TimerService 的通道容量。
§Examples (示例)
use kestrel_timer::config::ServiceConfig;
use std::num::NonZeroUsize;
// Use default configuration (使用默认配置)
let config = ServiceConfig::default();
// Use Builder to customize configuration (使用 Builder 自定义配置)
let config = ServiceConfig::builder()
.command_channel_capacity(NonZeroUsize::new(1024).unwrap())
.timeout_channel_capacity(NonZeroUsize::new(2000).unwrap())
.build();Fields§
§command_channel_capacity: NonZeroUsizeCommand channel capacity
命令通道容量
timeout_channel_capacity: NonZeroUsizeTimeout channel capacity
超时通道容量
Implementations§
Source§impl ServiceConfig
impl ServiceConfig
Sourcepub fn builder() -> ServiceConfigBuilder
pub fn builder() -> ServiceConfigBuilder
Create configuration builder (创建配置构建器)
Trait Implementations§
Source§impl Clone for ServiceConfig
impl Clone for ServiceConfig
Source§fn clone(&self) -> ServiceConfig
fn clone(&self) -> ServiceConfig
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 ServiceConfig
impl Debug for ServiceConfig
Auto Trait Implementations§
impl Freeze for ServiceConfig
impl RefUnwindSafe for ServiceConfig
impl Send for ServiceConfig
impl Sync for ServiceConfig
impl Unpin for ServiceConfig
impl UnwindSafe for ServiceConfig
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