pub struct SearchBuilder { /* private fields */ }Expand description
A fluent builder for constructing SearchParams.
This builder helps create a SearchParams struct, which can be passed to
the Client::search or Client::search_get methods.
Implementations§
Source§impl SearchBuilder
impl SearchBuilder
Sourcepub fn limit(self, limit: u32) -> Self
pub fn limit(self, limit: u32) -> Self
Sets the maximum number of items to return (the limit parameter).
Sourcepub fn bbox(self, bbox: Vec<f64>) -> Self
pub fn bbox(self, bbox: Vec<f64>) -> Self
Sets the spatial bounding box for the search.
The coordinates must be in the order: [west, south, east, north].
An optional fifth and sixth element can be used to specify a vertical
range ([min_elevation, max_elevation]).
Sourcepub fn datetime(self, datetime: &str) -> Self
pub fn datetime(self, datetime: &str) -> Self
Sets the temporal window for the search using a datetime string.
This can be a single datetime or a closed/open interval. See the STAC API spec for valid formats.
Sourcepub fn collections(self, collections: Vec<String>) -> Self
pub fn collections(self, collections: Vec<String>) -> Self
Restricts the search to a set of collection IDs.
Sourcepub fn intersects(self, geometry: Value) -> Self
pub fn intersects(self, geometry: Value) -> Self
Filters items that intersect a GeoJSON geometry.
Sourcepub fn query(self, key: &str, value: Value) -> Self
pub fn query(self, key: &str, value: Value) -> Self
Adds a filter expression using the STAC Query Extension.
If a query already exists for the given key, it will be overwritten.
Sourcepub fn sort_by(self, field: &str, direction: SortDirection) -> Self
pub fn sort_by(self, field: &str, direction: SortDirection) -> Self
Adds a sorting rule. Multiple calls will append additional sort rules.
Sourcepub fn include_fields(self, fields: Vec<String>) -> Self
pub fn include_fields(self, fields: Vec<String>) -> Self
Includes only the specified fields in the response.
This will overwrite any previously set include fields.
Sourcepub fn exclude_fields(self, fields: Vec<String>) -> Self
pub fn exclude_fields(self, fields: Vec<String>) -> Self
Excludes the specified fields from the response.
This will overwrite any previously set exclude fields.
Sourcepub fn build(self) -> SearchParams
pub fn build(self) -> SearchParams
Finalizes the builder and returns the constructed SearchParams.