pub struct HttpProvider { /* private fields */ }Expand description
Provider for data: { url: "..." } shapes. Issues a GET via reqwest
(works on both native and WASM with no feature-flag branching).
Header handling:
with_default_headers(...)sets defaults that apply to every request.FetchRequest.headersoverrides any default with the same name on a per-request basis (matches HTTP intuition: per-call wins over default).
Decode rule:
Content-Type: application/vnd.apache.arrow.*→ decode as Arrow IPC bytes viaDataTable::from_ipc_bytes.- anything else → parse as JSON. JSON arrays of objects flow through
DataTable::from_rows; JSON objects with a top-level array key (rows,data, orresults) are unwrapped automatically to match the most common API conventions.
Implementations§
Source§impl HttpProvider
impl HttpProvider
Sourcepub fn new() -> Self
pub fn new() -> Self
New provider with no default headers. Convenience for the default
register_provider("http", HttpProvider::new()) registration.
Sourcepub fn with_default_headers(self, headers: HashMap<String, String>) -> Self
pub fn with_default_headers(self, headers: HashMap<String, String>) -> Self
Builder: attach default headers (e.g. Authorization, User-Agent)
applied to every request unless overridden by FetchRequest.headers.
Trait Implementations§
Source§impl DataSourceProvider for HttpProvider
impl DataSourceProvider for HttpProvider
Source§fn fetch<'life0, 'async_trait>(
&'life0 self,
request: FetchRequest,
) -> Pin<Box<dyn Future<Output = Result<FetchResult, FetchError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn fetch<'life0, 'async_trait>(
&'life0 self,
request: FetchRequest,
) -> Pin<Box<dyn Future<Output = Result<FetchResult, FetchError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Fetch one source. The resolver handles caching + dedup + parallelism;
providers only see this single call per actual upstream invocation.
Source§fn shutdown<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn shutdown<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Optional graceful shutdown hook. Called by
ChartML::shutdown() on
SSR request end / tab close. Default no-op so providers that hold no
pooled resources don’t have to implement it.Auto Trait Implementations§
impl Freeze for HttpProvider
impl !RefUnwindSafe for HttpProvider
impl Send for HttpProvider
impl Sync for HttpProvider
impl Unpin for HttpProvider
impl UnsafeUnpin for HttpProvider
impl !UnwindSafe for HttpProvider
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