pub struct CompletionStream { /* private fields */ }Expand description
A streaming response from a provider. Wraps a channel of StreamEvents.
Implementations§
Source§impl CompletionStream
impl CompletionStream
pub fn new(rx: Receiver<StreamEvent>) -> Self
Sourcepub async fn collect(self) -> Result<CompletionResponse>
pub async fn collect(self) -> Result<CompletionResponse>
Consume the stream and collect into a complete response.
Sourcepub fn into_receiver(self) -> Receiver<StreamEvent>
pub fn into_receiver(self) -> Receiver<StreamEvent>
Access the underlying receiver for real-time event processing.
Auto Trait Implementations§
impl Freeze for CompletionStream
impl RefUnwindSafe for CompletionStream
impl Send for CompletionStream
impl Sync for CompletionStream
impl Unpin for CompletionStream
impl UnsafeUnpin for CompletionStream
impl UnwindSafe for CompletionStream
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