Skip to main content

FanoutStream

Struct FanoutStream 

Source
pub struct FanoutStream<B: FanoutBridge>{ /* 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>

Source

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>

Keep one progress entry per child. Publication operation IDs and receipts survive cancellation, and resource budgets apply to the whole group.

Source

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>

Source§

impl<B: FanoutBridge> FanoutStream<B>

Source

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.

Source

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>

Source

pub fn children(&self) -> &[StreamInvocation<B>]

Source

pub fn response_id(&self) -> &str

Source

pub fn report(&self) -> &Report

Source

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>

§

impl<B> Send for FanoutStream<B>

§

impl<B> Unpin for FanoutStream<B>

§

impl<B> UnsafeUnpin for FanoutStream<B>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ResourceSend for T
where T: Send + ?Sized,

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.