pub struct InputDecoder { /* private fields */ }Expand description
Per-input receive state for the schema-once zenoh path: one persistent
StreamDecoder primed from the schema
published on the output’s @schema subtopic (or in-band, from the schema
block of a full self-describing stream on the data topic), then reused to
decode the schema-less batch messages that flow on the data topic.
Implementations§
Source§impl InputDecoder
impl InputDecoder
Sourcepub fn new() -> Self
pub fn new() -> Self
Create an unprimed decoder. It decodes nothing until a schema is
installed via set_schema (delivered from the output’s
@schema subtopic).
Sourcepub fn reset(&mut self)
pub fn reset(&mut self)
Forget all state — the primed decoder AND the retained schemas. The next schema message must re-establish priming. Used on producer restart and for lock-poison recovery.
Sourcepub fn knows_schema(&self, hash: u64) -> bool
pub fn knows_schema(&self, hash: u64) -> bool
Whether a schema with this hash is already available — live or retained.
The in-band priming path skips the schema-block copy and the eager
re-prime for known schemas; decode_batch
re-primes lazily from the retained set when a batch actually needs one,
so eagerly re-priming a retained schema would only churn the live
decoder (e.g. a large full-stream message of schema B clobbering the
live prime of schema A between A’s schema-less batches).
Sourcepub fn set_schema(&mut self, hash: u64, schema: ArrowBuffer) -> Result<()>
pub fn set_schema(&mut self, hash: u64, schema: ArrowBuffer) -> Result<()>
Install the schema for hash from a framed IPC schema message (the
payload published on the @schema subtopic, or the schema block of a
full stream received in-band): prime a fresh decoder with it and retain
the bytes for later local re-priming. A no-op when the live decoder is
already primed with hash.
Sourcepub fn decode_batch(
&mut self,
buffer: ArrowBuffer,
hash: u64,
) -> Result<Option<ArrayData>>
pub fn decode_batch( &mut self, buffer: ArrowBuffer, hash: u64, ) -> Result<Option<ArrayData>>
Decode a schema-less batch message against the decoder primed for hash.
If the live decoder is not primed for hash but a matching schema was
previously installed (e.g. after a soft reset), it re-primes from the
retained bytes first. Returns Ok(None) when no schema for hash is
known yet — the caller drops the message, which is fine on the lossy
CongestionControl::Drop data plane (the @schema history query, the
next schema publish, or the producer’s periodic full-stream refresh —
which primes in-band — will prime it).
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for InputDecoder
impl !UnwindSafe for InputDecoder
impl Freeze for InputDecoder
impl Send for InputDecoder
impl Sync for InputDecoder
impl Unpin for InputDecoder
impl UnsafeUnpin for InputDecoder
Blanket Implementations§
Source§impl<Source> AccessAs for Source
impl<Source> AccessAs for Source
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
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>
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>
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>
T in a tonic::Request