Skip to main content

ImModule

Struct ImModule 

Source
pub struct ImModule { /* private fields */ }
Expand description

IM 业务模块(实现 helix_core::Module trait)

Implementations§

Source§

impl ImModule

Source

pub fn with_diagnostic_session(self, login: String, device: String) -> Self

宿主在注册模块前注入诊断会话;不改变认证身份或业务协议。

Source§

impl ImModule

Source

pub fn with_sync_observer(self, observer: Arc<dyn SyncObserver>) -> Self

注入独立指标出口,诊断日志关闭时仍记录同步时间。

Source§

impl ImModule

Source

pub fn ingest_increment(&mut self, inc: &IncrementChannel, out: &mut EffectSink)

B-rest 测试 / driver 入口:直接喂一个解析好的 increment_channel 帧。

Source§

impl ImModule

Source

pub fn new(config: ImConfig) -> Self

PC/Flutter 默认使用 durable host store。

Source

pub fn new_with_local_store( config: ImConfig, local_store_mode: LocalStoreMode, ) -> Self

Web 可注入 Session/Disabled;三端业务 query API 保持一致。

Source

pub fn local_store_mode(&self) -> LocalStoreMode

Source

pub fn alloc_corr(&mut self) -> Correlation

Source

pub fn alloc_timer(&mut self) -> TimerId

Source

pub fn register_channel(&mut self, id: ChannelId, initial_cursor: u64)

测试 / driver 初始化用:预注册一个 channel(初始 cursor 值由调用方提供)

Source

pub fn cursor_for(&self, channel_id: ChannelId) -> Option<u64>

查询 per-channel cursor(测试 / 诊断用)

Source

pub fn terminal_event_seq_for(&self, channel_id: ChannelId) -> Option<u64>

查询已确认的 type7 terminal tombstone 水位(测试 / 诊断用)。

Source

pub fn pending_send_count(&self) -> usize

查询 pending_sends 数量(测试用)

Source

pub fn chain_mutation_state( &self, client_mutation_id: &str, ) -> Option<ChainMutationState>

查询文字接龙 mutation 的本地状态,供 bridge 映射稳定状态而非重算业务事实。

Source

pub fn chain_operation_id(&self, client_mutation_id: &str) -> Option<&str>

查询由 Helix 生成的稳定 operationId,供 reconcile 继续使用同一业务操作。

Source

pub fn sync_inflight(&self) -> usize

B4:全局在途 sync 数 + 待 dispatch 队列长(HX-C011 证伪性质测试结构化断言用)。

Source

pub fn sync_pending_len(&self) -> usize

Source

pub fn pending_send_status(&self, temporary_id: &str) -> Option<SendStatus>

查询某 temporary_id 的 PendingSend 状态(测试 / 诊断用)。 用于 C1 echo→reconcile 断言「对账后 PendingSend 推进到 Sent」。

Source

pub fn increment_fetched_contains(&self, channel_id: ChannelId) -> bool

查询 increment_fetched 是否含某 channel(测试 / 诊断用)。

Source

pub fn increment_target_for(&self, channel_id: ChannelId) -> Option<u64>

查询某 channel 的 increment_target(服务端水位,测试 / 诊断用)。 cursor(本地确认)与 target(服务端水位)严格解耦——HX-C008 回归断言锚点。

Source

pub fn ingest_increment_end( &mut self, ch: Option<ChannelId>, out: &mut EffectSink, )

B-rest 测试 / driver 入口:直接喂 increment_channel_end 信号。 Some(ch)=子 topic 结束;None=global end(触发增量群 sync)。

Trait Implementations§

Source§

impl Module for ImModule

Source§

fn accepts(&self, tick: &Tick) -> bool

路由判定:IM 模块处理所有 IM Inbound 帧和 IM 命令。 PortReply / Timer 不走此方法(通过 corr_map 定向路由)。

MV3-G02e 草稿族(im_save_draft / im_query_draft)在此与下面的 handle 同源放行(crate::draft::is_draft_command):accepts 与 handle 各写一份命令名 正是「query 族被 accepts 闸静默丢弃」旧事故的成因,本族不重复该反模式。

Source§

fn handle( &mut self, tick: &Tick, now_ms: u64, out: &mut EffectSink, ) -> Result<(), CoreError>

处理一个 Tick,零 I/O,零 await。

Source§

fn on_start(&mut self, out: &mut EffectSink) -> Result<(), CoreError>

启动:先 Scan channel_event_cursor 与 channel 投影,过滤终态后才触发 proactive sync。

Source§

fn on_stop(&mut self, out: &mut EffectSink) -> Result<(), CoreError>

停止:取消所有 timer + 关闭连接

Source§

fn name(&self) -> &'static str

模块唯一名称(用于日志 / 调试 / error 报告)

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> MaybeSend for T
where T: Send,

Source§

impl<T> MaybeSync for T
where T: Sync,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more