pub struct MemorySource { /* private fields */ }Expand description
In-memory Source driven entirely by its SourceHandle.
Trait Implementations§
Source§impl Debug for MemorySource
impl Debug for MemorySource
Source§impl Source for MemorySource
impl Source for MemorySource
Source§fn component_type(&self) -> &str
fn component_type(&self) -> &str
Scopes the source’s own metric families under spate_memory_source_*.
Source§type Lane = MemoryLane
type Lane = MemoryLane
The lane type this source produces.
Source§fn open(&mut self, ctx: SourceCtx) -> Result<(), SourceError>
fn open(&mut self, ctx: SourceCtx) -> Result<(), SourceError>
Connect and prepare. Called once before any other method.
Source§fn poll_events(
&mut self,
timeout: Duration,
) -> Result<SourceEvent<MemoryLane>, SourceError>
fn poll_events( &mut self, timeout: Duration, ) -> Result<SourceEvent<MemoryLane>, SourceError>
Service control-plane work (rebalance callbacks, statistics) and
return the next event, waiting at most
timeout. Must be called
regularly regardless of backpressure state.Source§fn commit(
&mut self,
watermarks: &[(PartitionId, i64)],
) -> Result<(), SourceError>
fn commit( &mut self, watermarks: &[(PartitionId, i64)], ) -> Result<(), SourceError>
Store per-partition committable positions (each is the offset one
past the last acknowledged record). Positions are durable per the
source’s own policy (e.g. interval auto-commit of stored offsets).
Source§fn flush_commits(&mut self) -> Result<(), SourceError>
fn flush_commits(&mut self) -> Result<(), SourceError>
Synchronously flush stored positions (shutdown, revocation).
Source§fn pause(&mut self, lanes: &[LaneId]) -> Result<(), SourceError>
fn pause(&mut self, lanes: &[LaneId]) -> Result<(), SourceError>
Stop fetching for
lanes (backpressure). Optional capability:
sources that cannot pause rely on bounded-queue pushback alone.Source§fn framing_contract(&self) -> FramingContract
fn framing_contract(&self) -> FramingContract
How the payloads this source emits are framed, so the framework can
pair it with a deserializer without the two being coordinated by hand
(see
FramingContract). A source that splits its own bytes into one
record per payload returns FramingContract::PerRecord; the default
is FramingContract::WholePayload — the source emits whole payloads
and the deserializer owns framing (Kafka, and any source that does not
frame).Auto Trait Implementations§
impl Freeze for MemorySource
impl RefUnwindSafe for MemorySource
impl Send for MemorySource
impl Sync for MemorySource
impl Unpin for MemorySource
impl UnsafeUnpin for MemorySource
impl UnwindSafe for MemorySource
Blanket Implementations§
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