pub struct GenerationWsTurn<'a, B: StreamBridge<NativeEvent = StreamEvent>> { /* private fields */ }Expand description
Owns the native turn while borrowing its caller-owned conversion progress. Dropping a nonterminal native turn poisons the connection; it never resends.
Implementations§
Source§impl GenerationWsTurn<'_, ResponsesToGeminiStream>
impl GenerationWsTurn<'_, ResponsesToGeminiStream>
Sourcepub async fn next_with_image_resources<S, R>(
&mut self,
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<S, R>(
&mut self,
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,
Perform actual URI publications while retaining the native WS turn and pending client events across cancellation of this individual future.
Source§impl<B: StreamBridge<NativeEvent = StreamEvent>> GenerationWsTurn<'_, B>
impl<B: StreamBridge<NativeEvent = StreamEvent>> GenerationWsTurn<'_, B>
pub async fn next<S: StateStore>( &mut self, state: &GenerationStateAccess<'_, S>, ) -> Result<Option<StreamChunk<B::ClientEvent>>, TransformError>
pub async fn collect<S: StateStore>( &mut self, state: &GenerationStateAccess<'_, S>, ) -> Result<<<B as StreamBridge>::ClientEvent as NativeEvent>::Full, TransformError>
pub fn invocation(&self) -> &StreamInvocation<B>
pub fn failure_event(&self) -> Option<&StreamEvent>
pub fn websocket_failure(&self) -> Option<&ErrorMessage>
Auto Trait Implementations§
impl<'a, B> !Freeze for GenerationWsTurn<'a, B>
impl<'a, B> !RefUnwindSafe for GenerationWsTurn<'a, B>
impl<'a, B> !Sync for GenerationWsTurn<'a, B>
impl<'a, B> !UnwindSafe for GenerationWsTurn<'a, B>
impl<'a, B> Send for GenerationWsTurn<'a, B>where
&'a mut StreamInvocation<B>: Send,
impl<'a, B> Unpin for GenerationWsTurn<'a, B>where
&'a mut StreamInvocation<B>: Unpin,
impl<'a, B> UnsafeUnpin for GenerationWsTurn<'a, B>where
&'a mut StreamInvocation<B>: 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