pub trait SignalBuilder:
Default
+ Send
+ 'static {
type Request: Send + 'static;
const SIGNAL: &'static str;
// Required methods
fn has_headroom_for(&self, req: &Self::Request) -> bool;
fn append_request(&mut self, req: &Self::Request) -> Result<usize>;
fn approx_bytes(&self) -> usize;
fn is_empty(&self) -> bool;
fn finish(&mut self) -> Result<Sealed>;
fn snapshot(&self) -> Result<Sealed>;
}Expand description
One signal’s accumulator, from the flusher’s point of view.
Required Associated Constants§
Required Associated Types§
Required Methods§
Sourcefn has_headroom_for(&self, req: &Self::Request) -> bool
fn has_headroom_for(&self, req: &Self::Request) -> bool
Whether req is guaranteed to fit without overflowing a UInt16
dictionary or id space.
Must be conservative: an Arrow builder cannot be rolled back, so the
flusher relies on a true here meaning Self::append_request will not
fail on capacity. Answering false unnecessarily costs a slightly small
block; answering true wrongly wedges the node.
Sourcefn append_request(&mut self, req: &Self::Request) -> Result<usize>
fn append_request(&mut self, req: &Self::Request) -> Result<usize>
Absorb one export request, returning the number of root-table rows added.
Sourcefn approx_bytes(&self) -> usize
fn approx_bytes(&self) -> usize
Rough resident cost, with variable-width heaps measured rather than estimated from row counts — a 32 KB GenAI prompt must not weigh the same as a 20-byte one.
fn is_empty(&self) -> bool
Sourcefn finish(&mut self) -> Result<Sealed>
fn finish(&mut self) -> Result<Sealed>
Seal and reset. After this returns, self is a fresh builder — including
on the error path, where the caller has no way to know how far through
the column-by-column finish it got.
Sourcefn snapshot(&self) -> Result<Sealed>
fn snapshot(&self) -> Result<Sealed>
Materialise the rows accumulated so far without resetting, for
Open. Sidecar-free; see Sealed::with.
Costs one buffer copy per column, so the flusher only calls it when its
channel has drained — under sustained ingest the channel never empties,
the snapshot never runs, and the read-your-writes window closes on its
own because a busy block seals in well under max_block_age.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".