pub struct CallbackStream { /* private fields */ }Expand description
带回调的流式响应
Implementations§
Source§impl CallbackStream
impl CallbackStream
Sourcepub fn new(inner: MessageStream, on_chunk: Option<OnChunkCallback>) -> Self
pub fn new(inner: MessageStream, on_chunk: Option<OnChunkCallback>) -> Self
创建带回调的流
Sourcepub fn abort_flag(&self) -> Arc<AtomicBool>
pub fn abort_flag(&self) -> Arc<AtomicBool>
获取中断标志
Sourcepub async fn next_event(&mut self) -> Result<Option<StreamEvent>>
pub async fn next_event(&mut self) -> Result<Option<StreamEvent>>
获取下一个事件
Auto Trait Implementations§
impl !RefUnwindSafe for CallbackStream
impl !UnwindSafe for CallbackStream
impl Freeze for CallbackStream
impl Send for CallbackStream
impl Sync for CallbackStream
impl Unpin for CallbackStream
impl UnsafeUnpin for CallbackStream
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