pub struct Datasets<'a> { /* private fields */ }Expand description
/v1/datasets — the unified dataset index over crawl- and workflow-sourced
extracted data. Metadata is typed (DatasetList/DatasetMeta); the
records/export shapes are query-engine-driven, so those stay loosely typed
(as with the Data surface).
Implementations§
Source§impl Datasets<'_>
impl Datasets<'_>
Sourcepub async fn list(&self) -> Result<DatasetList>
pub async fn list(&self) -> Result<DatasetList>
GET /v1/datasets — datasets that have accumulated extracted data. Not
a Page: the daemon answers {datasets: [...]}, so this returns a
DatasetList (unwrap its datasets field).
Sourcepub async fn get(&self, id: i64) -> Result<DatasetMeta>
pub async fn get(&self, id: i64) -> Result<DatasetMeta>
GET /v1/datasets/:id — one dataset’s metadata + schema (404 if missing).
Sourcepub async fn records(&self, id: i64, query: &[(&str, &str)]) -> Result<Value>
pub async fn records(&self, id: i64, query: &[(&str, &str)]) -> Result<Value>
GET /v1/datasets/:id/records — the dataset’s row table. Pass query params
through as given (q, filter, filters, sort_by, sort_dir, limit,
offset, include_inputs, collection). Query-engine-shaped, so the
response stays a loosely-typed Value.
Sourcepub async fn export(&self, id: i64, query: &[(&str, &str)]) -> Result<String>
pub async fn export(&self, id: i64, query: &[(&str, &str)]) -> Result<String>
GET /v1/datasets/:id/export — raw export text. format=json|csv|markdown|html
plus the same filters as Datasets::records, via query params. markdown/html
are content-aware: a crawl’s pages export as readable documents, structured data
as a table.
Sourcepub async fn records_text(
&self,
id: i64,
format: DatasetFormat,
query: &[(&str, &str)],
) -> Result<String>
pub async fn records_text( &self, id: i64, format: DatasetFormat, query: &[(&str, &str)], ) -> Result<String>
GET /v1/datasets/:id/records RENDERED as text — the ?format= twin of
Datasets::records.
A non-json format returns prose/CSV rather than the JSON envelope, so it
needs its own method (Rust has no return-type overloading). Pass
DatasetFormat::Markdown to read a crawl’s pages as documents, or a
structured dataset as a table.
Sourcepub async fn search_text(
&self,
q: &str,
format: DatasetFormat,
params: &[(&str, &str)],
) -> Result<String>
pub async fn search_text( &self, q: &str, format: DatasetFormat, params: &[(&str, &str)], ) -> Result<String>
GET /v1/datasets/search RENDERED as text — the ?format= twin of
Datasets::search. The per-result dataset tag + highlight snippet exist
only in the JSON shape.
Sourcepub async fn search_one_text(
&self,
id: i64,
q: &str,
format: DatasetFormat,
params: &[(&str, &str)],
) -> Result<String>
pub async fn search_one_text( &self, id: i64, q: &str, format: DatasetFormat, params: &[(&str, &str)], ) -> Result<String>
GET /v1/datasets/:id/search RENDERED as text — the ?format= twin of
Datasets::search_one.
Sourcepub async fn search(
&self,
q: &str,
params: &[(&str, &str)],
) -> Result<DatasetSearchResult>
pub async fn search( &self, q: &str, params: &[(&str, &str)], ) -> Result<DatasetSearchResult>
GET /v1/datasets/search — full-text search across all datasets. q
is prepended to params (typically limit/offset) as the q query
pair.
Sourcepub async fn search_one(
&self,
id: i64,
q: &str,
params: &[(&str, &str)],
) -> Result<DatasetSearchResult>
pub async fn search_one( &self, id: i64, q: &str, params: &[(&str, &str)], ) -> Result<DatasetSearchResult>
GET /v1/datasets/:id/search — full-text search within one dataset. q
is prepended to params (typically limit/offset) as the q query
pair.