pub struct SseReader { /* private fields */ }Expand description
Reads server-sent events from a response until it ends or cancel fires.
Implementations§
Source§impl SseReader
impl SseReader
Sourcepub fn new(response: Response) -> SseReader
pub fn new(response: Response) -> SseReader
Reads response as an event stream, as the provider SDKs do: a
cancelled read fails with ABORTED_DURING_STREAM.
Sourcepub fn fetch(response: Response) -> SseReader
pub fn fetch(response: Response) -> SseReader
Reads with plain fetch, as pi’s Anthropic client does: a cancelled
read fails with ABORTED_READ.
Auto Trait Implementations§
impl !RefUnwindSafe for SseReader
impl !UnwindSafe for SseReader
impl Forget for SseReader
impl Freeze for SseReader
impl Send for SseReader
impl Sync for SseReader
impl Unpin for SseReader
impl UnsafeUnpin for SseReader
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