pub struct RealtimeStream { /* private fields */ }Available on crate feature
websockets only.Expand description
An open realtime stream. Send one Subscribe (done for you by
Client::connect_realtime), then poll RealtimeStream::next_event.
Implementations§
Source§impl RealtimeStream
impl RealtimeStream
Sourcepub async fn subscribe(&mut self, subscribe: &Subscribe) -> Result<(), Error>
pub async fn subscribe(&mut self, subscribe: &Subscribe) -> Result<(), Error>
Send a new subscribe filter on the open connection.
Sourcepub async fn next_event(&mut self) -> Result<RealtimeEvent, Error>
pub async fn next_event(&mut self) -> Result<RealtimeEvent, Error>
Await the next frame. Control frames (ping/pong) are answered
transparently; a server close yields RealtimeEvent::Closed
(and then keeps yielding it).
Auto Trait Implementations§
impl !Freeze for RealtimeStream
impl !RefUnwindSafe for RealtimeStream
impl !UnwindSafe for RealtimeStream
impl Send for RealtimeStream
impl Sync for RealtimeStream
impl Unpin for RealtimeStream
impl UnsafeUnpin for RealtimeStream
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