pub struct WebSocketClient { /* private fields */ }Expand description
Streams enriched articles in real time. Duplicate articles (same link within the last 10 deliveries) are suppressed.
Implementations§
Source§impl WebSocketClient
impl WebSocketClient
Sourcepub fn new(cfg: Config, opts: WebSocketOptions) -> Self
pub fn new(cfg: Config, opts: WebSocketOptions) -> Self
Returns a streaming client with custom options. Client instances
created by Client::new use default options.
Sourcepub fn stream(
&self,
params: GetArticlesWebSocketParams,
) -> ArticleStream<Article>
pub fn stream( &self, params: GetArticlesWebSocketParams, ) -> ArticleStream<Article>
Connects to the finlight WebSocket and yields articles matching
params. Reconnects (exponential backoff, proactive rotation,
rate-limit waits) are handled internally. Err items are terminal
(e.g. Error::Blocked); the stream ends after yielding one. End the
stream by dropping it.
Must be called within a tokio runtime.
Auto Trait Implementations§
impl !RefUnwindSafe for WebSocketClient
impl !UnwindSafe for WebSocketClient
impl Freeze for WebSocketClient
impl Send for WebSocketClient
impl Sync for WebSocketClient
impl Unpin for WebSocketClient
impl UnsafeUnpin for WebSocketClient
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