pub struct Client { /* private fields */ }Expand description
Client of the finlight API v3. Cheap to clone; clones share the HTTP client. Safe to use from many tasks, with many streams at the same time.
Implementations§
Source§impl Client
impl Client
Sourcepub fn new(config: Config) -> Result<Self>
pub fn new(config: Config) -> Result<Self>
Builds a client. Fails with Error::Validation for an empty API key or a bad URL.
Sourcepub async fn stream(
&self,
params: StreamParams,
options: StreamOptions,
) -> Result<FinlightStream>
pub async fn stream( &self, params: StreamParams, options: StreamOptions, ) -> Result<FinlightStream>
Opens the enriched stream. The parameters are checked here; the connection opens in the background, and every outcome arrives through the returned stream. Needs a tokio runtime.
Sourcepub async fn raw_stream(
&self,
params: RawStreamParams,
options: StreamOptions,
) -> Result<FinlightStream>
pub async fn raw_stream( &self, params: RawStreamParams, options: StreamOptions, ) -> Result<FinlightStream>
Opens the raw stream (article skeletons only, before enrichment).
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Client
impl !UnwindSafe for Client
impl Forget for Client
impl Freeze for Client
impl Move for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl UnsafeUnpin for Client
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