pub struct KernelBuilder { /* private fields */ }Expand description
Implementations§
Source§impl KernelBuilder
impl KernelBuilder
Sourcepub fn config_from_str(self, toml_str: &str) -> Self
pub fn config_from_str(self, toml_str: &str) -> Self
从 TOML 字符串加载设备配置。
配置解析错误会保存到内核,并由 Kernel::boot 返回。
Sourcepub fn config_from_file(self, path: impl AsRef<Path>) -> Self
pub fn config_from_file(self, path: impl AsRef<Path>) -> Self
从 TOML 文件加载设备配置。
配置加载错误会保存到内核,并由 Kernel::boot 返回。
Sourcepub fn with_protocol(self, protocol: Box<dyn Protocol>) -> Self
pub fn with_protocol(self, protocol: Box<dyn Protocol>) -> Self
注册一个协议实例。
Sourcepub fn with_connection_strategy(self, strategy: ConnectionStrategy) -> Self
pub fn with_connection_strategy(self, strategy: ConnectionStrategy) -> Self
设置设备连接策略。
Sourcepub fn with_event_capacity(self, cap: usize) -> Self
pub fn with_event_capacity(self, cap: usize) -> Self
设置事件总线通道缓冲区大小。
Sourcepub fn with_gateway_interval(self, ms: u64) -> Self
pub fn with_gateway_interval(self, ms: u64) -> Self
设置网关引擎的轮询间隔(毫秒)。
Auto Trait Implementations§
impl !RefUnwindSafe for KernelBuilder
impl !UnwindSafe for KernelBuilder
impl Freeze for KernelBuilder
impl Send for KernelBuilder
impl Sync for KernelBuilder
impl Unpin for KernelBuilder
impl UnsafeUnpin for KernelBuilder
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