pub struct LongpollConsumer { /* private fields */ }Expand description
Tokenless long-poll consumer. Construct via LongpollConsumer::new or
LongpollConsumer::builder.
Implementations§
Source§impl LongpollConsumer
impl LongpollConsumer
Sourcepub fn new(category: impl Into<String>) -> Self
pub fn new(category: impl Into<String>) -> Self
Build a consumer with the standard defaults.
§Panics
Panics only if reqwest::Client::build() fails — exceedingly rare.
Sourcepub fn builder(category: impl Into<String>) -> LongpollConsumerBuilder
pub fn builder(category: impl Into<String>) -> LongpollConsumerBuilder
Begin building a LongpollConsumer.
Sourcepub fn iterate(&self, opts: LongpollIterateOptions) -> LongpollPoll
pub fn iterate(&self, opts: LongpollIterateOptions) -> LongpollPoll
Begin a longpoll subscription. Returns a LongpollPoll handle whose
typed streams (matches / notifications / errors) are fed by a
background tokio task. Drop the handle (or call close().await) to
shut it down.
Server keepalive ticks ({"timeout": "no events before timeout"}) are
silently absorbed.
Sourcepub fn close(self)
pub fn close(self)
Drop the underlying HTTP transport explicitly. Equivalent to dropping
the LongpollConsumer.
Trait Implementations§
Source§impl Clone for LongpollConsumer
impl Clone for LongpollConsumer
Source§fn clone(&self) -> LongpollConsumer
fn clone(&self) -> LongpollConsumer
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for LongpollConsumer
impl !RefUnwindSafe for LongpollConsumer
impl Send for LongpollConsumer
impl Sync for LongpollConsumer
impl Unpin for LongpollConsumer
impl UnsafeUnpin for LongpollConsumer
impl !UnwindSafe for LongpollConsumer
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