Skip to content

Commit

Permalink
Merge #565
Browse files Browse the repository at this point in the history
565: Update version for the next release (v0.26.0) r=curquiza a=meili-bot

_This PR is auto-generated._

The automated script updates the version of meilisearch-rust to a new version: "v0.26.0"


Co-authored-by: meili-bot <[email protected]>
  • Loading branch information
meili-bors[bot] and meili-bot authored Apr 15, 2024
2 parents 437649f + 08230dc commit e5c665c
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 26 deletions.
2 changes: 1 addition & 1 deletion .code-samples.meilisearch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -993,7 +993,7 @@ primary_field_guide_add_document_primary_key: |-
getting_started_add_documents_md: |-
```toml
[dependencies]
meilisearch-sdk = "0.25.0"
meilisearch-sdk = "0.26.0"
# futures: because we want to block on futures
futures = "0.3"
# serde: required if you are going to use documents
Expand Down
27 changes: 13 additions & 14 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "meilisearch-sdk"
version = "0.25.0"
version = "0.26.0"
authors = ["Mubelotix <[email protected]>"]
edition = "2018"
description = "Rust wrapper for the Meilisearch API. Meilisearch is a powerful, fast, open-source, easy to use and deploy search engine."
Expand All @@ -18,28 +18,28 @@ log = "0.4"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
time = { version = "0.3.7", features = ["serde-well-known", "formatting", "parsing"] }
jsonwebtoken = { version = "9", default-features = false }
yaup = "0.2.0"
either = { version = "1.8.0", features = ["serde"] }
thiserror = "1.0.37"
meilisearch-index-setting-macro = { path = "meilisearch-index-setting-macro", version = "0.25.0" }
pin-project-lite = { version = "0.2.13", optional = true }
reqwest = { version = "0.12.3", optional = true, default-features = false, features = ["rustls-tls", "http2", "stream"] }
bytes = { version = "1.6", optional = true }
uuid = { version = "1.1.2", features = ["v4"] }
futures-io = "0.3.30"
futures = "0.3"
meilisearch-index-setting-macro = { path = "meilisearch-index-setting-macro", version = "0.26.0" }

[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
jsonwebtoken = { version = "9", default-features = false }
futures = "0.3"
futures-io = "0.3.26"
isahc = { version = "1.0", features = ["http2", "text-decoding"], optional = true, default_features = false }
uuid = { version = "1.1.2", features = ["v4"] }

[target.'cfg(target_arch = "wasm32")'.dependencies]
uuid = { version = "1.8.0", default-features = false, features = ["v4", "js"] }
web-sys = "0.3"
js-sys = "0.3.47"
web-sys = { version = "0.3", features = ["RequestInit", "Headers", "Window", "Response", "console"] }
wasm-bindgen = "0.2"
wasm-bindgen-futures = "0.4"

[features]
default = ["reqwest"]
reqwest = ["dep:reqwest", "pin-project-lite", "bytes"]
default = ["isahc", "isahc", "isahc-static-curl"]
isahc-static-curl = ["isahc", "isahc", "isahc/static-curl"]
isahc-static-ssl = ["isahc/static-ssl"]

[dev-dependencies]
futures-await-test = "0.3"
Expand All @@ -56,4 +56,3 @@ lazy_static = "1.4"
web-sys = "0.3"
console_error_panic_hook = "0.1"
big_s = "1.0.2"
insta = "1.38.0"
17 changes: 8 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ To use `meilisearch-sdk`, add this to your `Cargo.toml`:

```toml
[dependencies]
meilisearch-sdk = "0.25.0"
meilisearch-sdk = "0.26.0"
```

The following optional dependencies may also be useful:
Expand Down Expand Up @@ -108,10 +108,9 @@ struct Movie {
}


#[tokio::main(flavor = "current_thread")]
async fn main() {
fn main() { block_on(async move {
// Create a client (without sending any request so that can't fail)
let client = Client::new(MEILISEARCH_URL, Some(MEILISEARCH_API_KEY)).unwrap();
let client = Client::new(MEILISEARCH_URL, Some(MEILISEARCH_API_KEY));

// An index is where the documents are stored.
let movies = client.index("movies");
Expand All @@ -125,7 +124,7 @@ async fn main() {
Movie { id: 5, title: String::from("Moana"), genres: vec!["Fantasy".to_string(), "Action".to_string()] },
Movie { id: 6, title: String::from("Philadelphia"), genres: vec!["Drama".to_string()] },
], Some("id")).await.unwrap();
}
})}
```

With the `uid`, you can check the status (`enqueued`, `canceled`, `processing`, `succeeded` or `failed`) of your documents addition using the [task](https://www.meilisearch.com/docs/reference/api/tasks#get-task).
Expand Down Expand Up @@ -239,11 +238,11 @@ Json output:
}
```

#### Customize the `HttpClient` <!-- omit in TOC -->
#### Using users customized HttpClient <!-- omit in TOC -->

By default, the SDK uses [`reqwest`](https://docs.rs/reqwest/latest/reqwest/) to make http calls.
The SDK lets you customize the http client by implementing the `HttpClient` trait yourself and
initializing the `Client` with the `new_with_client` method.
If you want to change the `HttpClient` you can incorporate using the `Client::new_with_client` method.
To use it, you need to implement the `HttpClient Trait`(`isahc` is used by default).
There are [using-reqwest-example](./examples/cli-app-with-reqwest) of using `reqwest`.

## 🌐 Running in the Browser with WASM <!-- omit in TOC -->

Expand Down
2 changes: 1 addition & 1 deletion README.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ To use `meilisearch-sdk`, add this to your `Cargo.toml`:

```toml
[dependencies]
meilisearch-sdk = "0.25.0"
meilisearch-sdk = "0.26.0"
```

The following optional dependencies may also be useful:
Expand Down
2 changes: 1 addition & 1 deletion meilisearch-index-setting-macro/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "meilisearch-index-setting-macro"
version = "0.25.0"
version = "0.26.0"
description = "Helper tool to generate settings of a Meilisearch index"
edition = "2021"
license = "MIT"
Expand Down

0 comments on commit e5c665c

Please sign in to comment.