[−][src]Trait stellr::SolrRequest
Common methods for solr requests
The most important method here is "call" which outputs a deserialised instance. The other method is unstructured_call(), which hard-codes the output to be a serde_json::Value.
The SolrRequest trait is applied to the reqwest::RequestBuilder, as an extension trait (hence it is important to use the stellr prelude).
There are two versions of this trait, one for async requests, and one for blocking requests. This is controlled by the "blocking" feature for the stellr crate.
Helper structs for deserialisation are found under request::types, to simplify the legwork with common tasks.
Errors
If the response is not valid JSON (eg. if it return a stack trace or an HTML error page) then a SolrError::ResponseParseError will be returned, which will contain the underlying serde error message.
Required methods
#[must_use]pub fn call<'async_trait, T: DeserializeOwned>(
self
) -> Pin<Box<dyn Future<Output = SolrResult<T>> + Send + 'async_trait>> where
T: 'async_trait,
Self: 'async_trait,
[src]
self
) -> Pin<Box<dyn Future<Output = SolrResult<T>> + Send + 'async_trait>> where
T: 'async_trait,
Self: 'async_trait,
Convert the solr response into a user-defined struct (implementing the Deserialise trait)
#[must_use]pub fn unstructured_call<'async_trait>(
self
) -> Pin<Box<dyn Future<Output = SolrResult<Value>> + Send + 'async_trait>> where
Self: 'async_trait,
[src]
self
) -> Pin<Box<dyn Future<Output = SolrResult<Value>> + Send + 'async_trait>> where
Self: 'async_trait,
Convert the solr response into a serde_json::Value struct
Implementations on Foreign Types
impl SolrRequest for RequestBuilder
[src]
pub fn call<'async_trait, T: DeserializeOwned>(
self
) -> Pin<Box<dyn Future<Output = SolrResult<T>> + Send + 'async_trait>> where
T: 'async_trait,
Self: 'async_trait,
[src]
self
) -> Pin<Box<dyn Future<Output = SolrResult<T>> + Send + 'async_trait>> where
T: 'async_trait,
Self: 'async_trait,
pub fn unstructured_call<'async_trait>(
self
) -> Pin<Box<dyn Future<Output = SolrResult<Value>> + Send + 'async_trait>> where
Self: 'async_trait,
[src]
self
) -> Pin<Box<dyn Future<Output = SolrResult<Value>> + Send + 'async_trait>> where
Self: 'async_trait,