pub struct Correlation(/* private fields */);Expand description
不透明令牌:把 Effect::Persist / Effect::Http 与未来的 Tick::PortReply 配对。
ExecutionShell 维护 Correlation → module_index 映射(corr_map),
保证 PortReply 定向投递给发出该 Correlation 的模块(审查意见2 P3 落实)。
§MIN-1 修复
内部值改为 pub(crate) — 外部 crate 通过 raw() 只读访问,
只有 engine 的 CorrelationSource 可以创建新值,保证“ID 由分配器单调发放“不变量。
helix-im 通过 ImModule::alloc_corr() 获取(helix_core::Correlation::new_from_raw
是 pub(crate) 构造器,只对 helix-core 自身可见)。
由于 helix-im 是独立 crate,需要分配 Correlation,保留一个 pub 的 from_raw
构造器(但语义上调用方应通过模块内的 IdAllocator 管理,不得随意构造)。
Implementations§
Trait Implementations§
Source§impl Clone for Correlation
impl Clone for Correlation
impl Copy for Correlation
Source§impl Debug for Correlation
impl Debug for Correlation
impl Eq for Correlation
Source§impl Hash for Correlation
impl Hash for Correlation
Source§impl PartialEq for Correlation
impl PartialEq for Correlation
impl StructuralPartialEq for Correlation
Auto Trait Implementations§
impl Freeze for Correlation
impl RefUnwindSafe for Correlation
impl Send for Correlation
impl Sync for Correlation
impl Unpin for Correlation
impl UnsafeUnpin for Correlation
impl UnwindSafe for Correlation
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