pub struct StaticBase {
pub my_id: String,
pub host: String,
pub port: u16,
pub is_master: bool,
pub subscribers: HashMap<String, String>,
pub static_nodes: HashMap<String, String>,
pub publishers: HashMap<String, String>,
pub publish_hz: i64,
pub subscribe_hz: i64,
pub dynamic_load_enable: bool,
}Fields§
§my_id: String§host: String§port: u16§is_master: bool§subscribers: HashMap<String, String>§static_nodes: HashMap<String, String>静态节点 fallback:node_id -> “host:port”。当 discovery 未找到目标时使用。 支持无多播环境(Docker、云等)。
publishers: HashMap<String, String>§publish_hz: i64发布频率(Hz),节点级上限:
-
0: 所有 topic 的 publish_topic 默认按该频率限速
- =0: 动态频率(有多少发多快)
- -1: 不发布(publish_topic 直接丢弃)
subscribe_hz: i64订阅/处理频率(Hz),节点级上限:
-
0: 所有 try_recv_* 默认按该频率限速
- =0: 动态频率(按调用频率尝试收取)
- -1: 不订阅/不消费(try_recv_* 恒返回 None)
dynamic_load_enable: bool是否启用 dynamic 配置热更新(文件监听)。默认 true;置 false 时不创建 watcher,无额外开销。
Trait Implementations§
Source§impl Clone for StaticBase
impl Clone for StaticBase
Source§fn clone(&self) -> StaticBase
fn clone(&self) -> StaticBase
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 StaticBase
impl Debug for StaticBase
Source§impl<'de> Deserialize<'de> for StaticBase
impl<'de> Deserialize<'de> for StaticBase
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for StaticBase
impl RefUnwindSafe for StaticBase
impl Send for StaticBase
impl Sync for StaticBase
impl Unpin for StaticBase
impl UnsafeUnpin for StaticBase
impl UnwindSafe for StaticBase
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