pub struct FanoutStream<B: FanoutBridge>where
B::ClientEvent: FanoutEvent,{ /* private fields */ }Expand description
Caller-owned progress retains every child receipt and the active stream across cancellation, in memory only. Dropping it cancels the active body.
Implementations§
Source§impl FanoutStream<ResponsesToGeminiStream>
impl FanoutStream<ResponsesToGeminiStream>
Sourcepub async fn next_with_image_resources<U: Upstream, S, R>(
&mut self,
upstream: &U,
target: &U::Target,
state: &GenerationStateAccess<'_, S>,
resources: &GenerationResources<'_, R>,
progress: &mut [ImageStreamProgress<R::PublishedHandle>],
) -> Result<Option<StreamChunk<GenerateContentResponseBody>>, TransformError>where
R: ResourceAccess + ResourceSync,
R::Scope: ResourceSync,
R::PublishedHandle: ResourceSend,
S: StateStore + ResourceSync,
S::Scope: ResourceSync,
pub async fn next_with_image_resources<U: Upstream, S, R>(
&mut self,
upstream: &U,
target: &U::Target,
state: &GenerationStateAccess<'_, S>,
resources: &GenerationResources<'_, R>,
progress: &mut [ImageStreamProgress<R::PublishedHandle>],
) -> Result<Option<StreamChunk<GenerateContentResponseBody>>, TransformError>where
R: ResourceAccess + ResourceSync,
R::Scope: ResourceSync,
R::PublishedHandle: ResourceSend,
S: StateStore + ResourceSync,
S::Scope: ResourceSync,
Keep one progress entry per child. Publication operation IDs and receipts survive cancellation, and resource budgets apply to the whole group.
pub async fn collect_with_image_resources<U: Upstream, S, R>(
&mut self,
upstream: &U,
target: &U::Target,
state: &GenerationStateAccess<'_, S>,
resources: &GenerationResources<'_, R>,
progress: &mut [ImageStreamProgress<R::PublishedHandle>],
) -> Result<Converted<GenerateContentResponseBody>, TransformError>where
R: ResourceAccess + ResourceSync,
R::Scope: ResourceSync,
R::PublishedHandle: ResourceSend,
S: StateStore + ResourceSync,
S::Scope: ResourceSync,
Source§impl<B: FanoutBridge> FanoutStream<B>where
B::ClientEvent: FanoutEvent,
impl<B: FanoutBridge> FanoutStream<B>where
B::ClientEvent: FanoutEvent,
Sourcepub async fn next<U: Upstream, S: StateStore>(
&mut self,
upstream: &U,
target: &U::Target,
state: &GenerationStateAccess<'_, S>,
) -> Result<Option<StreamChunk<B::ClientEvent>>, TransformError>
pub async fn next<U: Upstream, S: StateStore>( &mut self, upstream: &U, target: &U::Target, state: &GenerationStateAccess<'_, S>, ) -> Result<Option<StreamChunk<B::ClientEvent>>, TransformError>
Starts each unstarted child once and returns incremental client bytes. Errors retain native receipts in memory; cancellation during a POST never triggers a second POST.
pub async fn collect<U: Upstream, S: StateStore>( &mut self, upstream: &U, target: &U::Target, state: &GenerationStateAccess<'_, S>, ) -> Result<Converted<<<B as StreamBridge>::ClientEvent as NativeEvent>::Full>, TransformError>
Source§impl<B: FanoutBridge> FanoutStream<B>where
B::ClientEvent: FanoutEvent,
impl<B: FanoutBridge> FanoutStream<B>where
B::ClientEvent: FanoutEvent,
pub fn children(&self) -> &[StreamInvocation<B>]
pub fn response_id(&self) -> &str
pub fn report(&self) -> &Report
pub fn client_result( &self, ) -> Option<&<<B as StreamBridge>::ClientEvent as NativeEvent>::Full>
Auto Trait Implementations§
impl<B> !RefUnwindSafe for FanoutStream<B>
impl<B> !Sync for FanoutStream<B>
impl<B> !UnwindSafe for FanoutStream<B>
impl<B> Freeze for FanoutStream<B>where
<B as StreamBridge>::ClientEvent: Sized,
Vec<StreamInvocation<B>>: Freeze,
Vec<<<B as StreamBridge>::ClientEvent as NativeEvent>::Full>: Freeze,
Option<<<B as StreamBridge>::ClientEvent as NativeEvent>::Collector>: Freeze,
Option<<<B as StreamBridge>::ClientEvent as NativeEvent>::Full>: Freeze,
Option<<B as StreamBridge>::ClientEvent>: Freeze,
impl<B> Send for FanoutStream<B>where
<B as StreamBridge>::ClientEvent: Sized,
Vec<StreamInvocation<B>>: Send,
Vec<<<B as StreamBridge>::ClientEvent as NativeEvent>::Full>: Send,
Option<<<B as StreamBridge>::ClientEvent as NativeEvent>::Collector>: Send,
Option<<<B as StreamBridge>::ClientEvent as NativeEvent>::Full>: Send,
Option<<B as StreamBridge>::ClientEvent>: Send,
impl<B> Unpin for FanoutStream<B>where
<B as StreamBridge>::ClientEvent: Sized,
Vec<StreamInvocation<B>>: Unpin,
Vec<<<B as StreamBridge>::ClientEvent as NativeEvent>::Full>: Unpin,
Option<<<B as StreamBridge>::ClientEvent as NativeEvent>::Collector>: Unpin,
Option<<<B as StreamBridge>::ClientEvent as NativeEvent>::Full>: Unpin,
Option<<B as StreamBridge>::ClientEvent>: Unpin,
impl<B> UnsafeUnpin for FanoutStream<B>where
<B as StreamBridge>::ClientEvent: Sized,
Vec<StreamInvocation<B>>: UnsafeUnpin,
Vec<<<B as StreamBridge>::ClientEvent as NativeEvent>::Full>: UnsafeUnpin,
Option<<<B as StreamBridge>::ClientEvent as NativeEvent>::Collector>: UnsafeUnpin,
Option<<<B as StreamBridge>::ClientEvent as NativeEvent>::Full>: UnsafeUnpin,
Option<<B as StreamBridge>::ClientEvent>: UnsafeUnpin,
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