pub struct ModelResponseEventStream { /* private fields */ }Expand description
Receiver for incremental canonical model stream events.
Implementations§
Source§impl ModelResponseEventStream
impl ModelResponseEventStream
Sourcepub fn new(
receiver: Receiver<Result<ModelResponseStreamEvent, ModelError>>,
) -> Self
pub fn new( receiver: Receiver<Result<ModelResponseStreamEvent, ModelError>>, ) -> Self
Build a stream from a channel receiver.
Sourcepub const fn new_with_cancellation(
receiver: Receiver<Result<ModelResponseStreamEvent, ModelError>>,
cancellation_token: CancellationToken,
) -> Self
pub const fn new_with_cancellation( receiver: Receiver<Result<ModelResponseStreamEvent, ModelError>>, cancellation_token: CancellationToken, ) -> Self
Build a stream from a channel receiver and cancellation token.
Sourcepub const fn new_with_cancellation_and_drop_abort(
receiver: Receiver<Result<ModelResponseStreamEvent, ModelError>>,
cancellation_token: CancellationToken,
drop_abort_token: Option<CancellationToken>,
) -> Self
pub const fn new_with_cancellation_and_drop_abort( receiver: Receiver<Result<ModelResponseStreamEvent, ModelError>>, cancellation_token: CancellationToken, drop_abort_token: Option<CancellationToken>, ) -> Self
Build a stream from a channel receiver, cancellation token, and drop-abort token.
Sourcepub fn drop_abort_token(&self) -> Option<CancellationToken>
pub fn drop_abort_token(&self) -> Option<CancellationToken>
Return the transport-local drop-abort token, when the stream owns one.
Sourcepub async fn recv(
&mut self,
) -> Option<Result<ModelResponseStreamEvent, ModelError>>
pub async fn recv( &mut self, ) -> Option<Result<ModelResponseStreamEvent, ModelError>>
Receive the next canonical model stream event.
Trait Implementations§
Source§impl Drop for ModelResponseEventStream
impl Drop for ModelResponseEventStream
Auto Trait Implementations§
impl Freeze for ModelResponseEventStream
impl RefUnwindSafe for ModelResponseEventStream
impl Send for ModelResponseEventStream
impl Sync for ModelResponseEventStream
impl Unpin for ModelResponseEventStream
impl UnsafeUnpin for ModelResponseEventStream
impl UnwindSafe for ModelResponseEventStream
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