Enum LlmCollector
Generated from cargo doc --no-deps -p nemo-relay -p nemo-relay-adaptive -p nemo-relay-pii-redaction -p nemo-relay-ffi -p nemo-relay-types -p nemo-relay-plugin -p nemo-relay-worker-proto -p nemo-relay-worker.
#[non_exhaustive]pub enum LlmCollector {
Sync(LlmCollectorFn),
Async(LlmAsyncCollectorFn),
}
Collector used to accumulate streaming response chunks.
An asynchronous collector still pending at close() is awaited after the producer closes, so it must settle once the producer does. Any FnMut(Json) -> Result<()> converts into the synchronous form.
Variants (Non-exhaustive)
Sync(LlmCollectorFn)
Sync(LlmCollectorFn)
Runs inline while the stream is polled.
Async(LlmAsyncCollectorFn)
Async(LlmAsyncCollectorFn)
Awaited before its chunk is yielded.
Implementations
impl LlmCollector
impl LlmCollector
new_async
pub fn new_async<F, Fut>(collector: F) -> Selfwhere
F: FnMut(Json) -> Fut + Send + 'static,
Fut: Future<Output = Result<()>> + Send + 'static,
Wrap a future-returning closure as an asynchronous collector.
Trait Implementations
impl<F> From<F> for LlmCollectorwhere F: FnMut(Json) -> Result<()> + Send + 'static,
impl<F> From<F> for LlmCollectorwhere
F: FnMut(Json) -> Result<()> + Send + 'static,
from
fn from(collector: F) -> Self