pub struct SlotBuffer { /* private fields */ }Expand description
Slot 缓冲区,用于有序模式下缓存同一 slot 的事件
Implementations§
Source§impl SlotBuffer
impl SlotBuffer
pub fn new() -> Self
Sourcepub fn flush_before(&mut self, current_slot: u64) -> Vec<DexEvent>
pub fn flush_before(&mut self, current_slot: u64) -> Vec<DexEvent>
输出所有小于 current_slot 的事件
Sourcepub fn should_timeout(&self, timeout_ms: u64) -> bool
pub fn should_timeout(&self, timeout_ms: u64) -> bool
检查是否超时
Sourcepub fn push_streaming(
&mut self,
slot: u64,
tx_index: u64,
event: DexEvent,
) -> Vec<DexEvent>
pub fn push_streaming( &mut self, slot: u64, tx_index: u64, event: DexEvent, ) -> Vec<DexEvent>
Streaming release: add event and return releasable continuous sequence NOTE: This mode assumes tx_index is continuous (0,1,2,3…) For filtered event streams where tx_index may not be continuous, use MicroBatch mode instead
Sourcepub fn flush_streaming_timeout(&mut self) -> Vec<DexEvent>
pub fn flush_streaming_timeout(&mut self) -> Vec<DexEvent>
流式模式超时释放
Trait Implementations§
Source§impl Default for SlotBuffer
impl Default for SlotBuffer
Source§fn default() -> SlotBuffer
fn default() -> SlotBuffer
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for SlotBuffer
impl RefUnwindSafe for SlotBuffer
impl Send for SlotBuffer
impl Sync for SlotBuffer
impl Unpin for SlotBuffer
impl UnwindSafe for SlotBuffer
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request