Skip to main content

EventLogReconcilePort

Struct EventLogReconcilePort 

Source
pub struct EventLogReconcilePort<'a, P: EventAppender> { /* private fields */ }
Expand description

把“结果未知,必须先对账”写成运行时事实的端口适配器(对账判定唯一口径在 qx-genglu 的 order_reconcile_verdict,本端口只落事实、不复制判定)。

Paper、CCXT 与 Binance worker 共用同一条写入路径:source_seq 由端口独占推进, correlation id 形如 <worker>:<tag>:<client_order_id>(tag 默认 reconcile, 各 worker 用自己的分类标签以保持既有审计口径)。reason 不会进入事件载荷 (EventLog schema 不变),但必须非空,并在写入失败时随错误一起返回,避免 “未知结果”连原因都留不下。

Implementations§

Source§

impl<'a, P: EventAppender> EventLogReconcilePort<'a, P>

Source

pub fn new( pipeline: &'a mut P, worker_id: &'a str, now: u64, source_seq: &'a mut u64, ) -> Self

Source

pub fn at_event_ts(self, event_ts: u64) -> Self

事件时间取远端回报时间,now 仍是本地接收时间。

Source

pub fn with_tag(self, tag: &'static str) -> Self

覆盖 correlation id 的分类标签,保持各 worker 既有口径不变。

Source

pub fn require_reconcile( &mut self, client_order_id: u64, reason: &str, ) -> Result<(), String>

把「结果未知,必须先对账」落成运行时事实。私有在 trait 里时编译器不会把它当 公共面,现在 trait 已删(全仓无 dyn ReconcilePort、无 T: ReconcilePort 约束, 三个调用点都拿具体类型 EventLogReconcilePort 直接调),所以方法必须显式 pub。

Auto Trait Implementations§

§

impl<'a, P> !UnwindSafe for EventLogReconcilePort<'a, P>

§

impl<'a, P> Forget for EventLogReconcilePort<'a, P>

§

impl<'a, P> Freeze for EventLogReconcilePort<'a, P>

§

impl<'a, P> Move for EventLogReconcilePort<'a, P>

§

impl<'a, P> RefUnwindSafe for EventLogReconcilePort<'a, P>

§

impl<'a, P> Send for EventLogReconcilePort<'a, P>
where &'a mut P: Send,

§

impl<'a, P> Sync for EventLogReconcilePort<'a, P>
where &'a mut P: Sync,

§

impl<'a, P> Unpin for EventLogReconcilePort<'a, P>

§

impl<'a, P> UnsafeUnpin for EventLogReconcilePort<'a, P>

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, 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, 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.