pub struct EventsResource<'c> { /* private fields */ }Expand description
client.events() — accessor for the SSE event stream.
Implementations§
Source§impl<'c> EventsResource<'c>
impl<'c> EventsResource<'c>
Sourcepub async fn stream(self) -> Result<EventsStream, PulseError>
pub async fn stream(self) -> Result<EventsStream, PulseError>
Subscribes to GET /api/pulse/events/stream and returns a Stream
of parsed events.
The future resolves once the HTTP response head is received (so auth
errors surface immediately rather than on the first poll). After
that, each call to StreamExt::next yields the next event as it
arrives on the wire.
Trait Implementations§
Auto Trait Implementations§
impl<'c> Freeze for EventsResource<'c>
impl<'c> !RefUnwindSafe for EventsResource<'c>
impl<'c> Send for EventsResource<'c>
impl<'c> Sync for EventsResource<'c>
impl<'c> Unpin for EventsResource<'c>
impl<'c> UnsafeUnpin for EventsResource<'c>
impl<'c> !UnwindSafe for EventsResource<'c>
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