Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion src/client.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use futures::Future;
use serde::{Deserialize, Serialize};
use serde_json::{json, Value};
use std::{collections::HashMap, time::Duration};
Expand All @@ -18,6 +19,12 @@ use crate::{
pub struct Client {
pub(crate) host: String,
pub(crate) api_key: String,
request_method: fn(
&str,
&str,
Method<Value, Value>,
u16,
) -> Box<dyn Future<Output = Result<Value, Error>> + Send>,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
Expand All @@ -40,10 +47,11 @@ impl Client {
/// // create the client
/// let client = Client::new(MEILISEARCH_URL, MEILISEARCH_API_KEY);
/// ```
pub fn new(host: impl Into<String>, api_key: impl Into<String>) -> Client {
pub fn new(host: impl Into<String>, api_key: impl Into<String>) -> Self {
Client {
host: host.into(),
api_key: api_key.into(),
request_method: request,
}
}

Expand Down