pub trait SerializedReader: Send {
// Required method
fn recv<'a>(
&'a mut self,
ctx: &'a RuntimeContext,
) -> RecvSerializedFuture<'a>;
// Provided method
fn recv_into<'a>(
&'a mut self,
ctx: &'a RuntimeContext,
_scratch: &'a mut [u8],
) -> RecvSerializedIntoFuture<'a> { ... }
}Expand description
A subscription to one record, fused with destination resolution and
serialization at registration time — no dyn Any crosses this boundary
.
Required Methods§
Sourcefn recv<'a>(&'a mut self, ctx: &'a RuntimeContext) -> RecvSerializedFuture<'a>
fn recv<'a>(&'a mut self, ctx: &'a RuntimeContext) -> RecvSerializedFuture<'a>
Yield the next successfully serialized value.
ctx is threaded per call (not captured) for context-aware
serializers. Buffer errors propagate unchanged:
DbError::BufferLagged means values were skipped but the reader
recovered; any other error means the buffer is gone. Serialization
failures are logged and skipped inside the reader.
Provided Methods§
Sourcefn recv_into<'a>(
&'a mut self,
ctx: &'a RuntimeContext,
_scratch: &'a mut [u8],
) -> RecvSerializedIntoFuture<'a>
fn recv_into<'a>( &'a mut self, ctx: &'a RuntimeContext, _scratch: &'a mut [u8], ) -> RecvSerializedIntoFuture<'a>
Yield the next serialized value into caller-owned scratch storage.
Third-party readers remain source-compatible: the default adapter calls
recv and returns its Vec<u8> as
SerializedPayload::Owned. AimDB’s fused reader overrides this method
when an into-slice serializer was registered.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".