finlight-client 0.2.0

Breaking release: speaks finlight API v3 only (0.1.x speaks v2). Official Rust client for the finlight.me API: financial news search, lookups, real-time streams and webhook verification.
Documentation
use std::sync::Arc;

use crate::client::Inner;
use crate::error::Result;
use crate::http::Request;
use crate::models::{SourceList, decode_sources};

/// Source catalog: `client.sources()`.
#[derive(Debug, Clone, Copy)]
pub struct Sources<'a> {
    pub(crate) inner: &'a Arc<Inner>,
}

impl Sources<'_> {
    /// The full source catalog, sorted by domain. `has_content` is `None` without
    /// `fullArticleAccess` (unknown, not "no content"). Costs 1 credit per request,
    /// errors included.
    pub async fn list(&self) -> Result<SourceList> {
        let resp = self
            .inner
            .transport
            .call(&Request::get("/v3/sources"))
            .await?;
        decode_sources(&resp.body)
    }
}