You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
132: Remove lifetimes r=curquiza a=ppamorim
In this large PR, I removed the requirement to use explicit lifetimes. This sorts the issue reported #127.
Please let me know if this PR removed any recent modifications in the code.
Co-authored-by: Pedro Paulo de Amorim <[email protected]>
Copy file name to clipboardExpand all lines: README.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -60,6 +60,7 @@ serde = { version = "1.0", features = ["derive"] }
60
60
```
61
61
62
62
This crate is `async` but you can choose to use an async runtime like [tokio](https://crates.io/crates/tokio) or just [block on futures](https://docs.rs/futures/latest/futures/executor/fn.block_on.html).
63
+
You can enable the `sync` feature to make most structs `Sync`. It may be a bit slower.
63
64
64
65
Using this crate is possible without [serde](https://crates.io/crates/serde), but a lot of features require serde.
Copy file name to clipboardExpand all lines: src/client.rs
+34-30Lines changed: 34 additions & 30 deletions
Original file line number
Diff line number
Diff line change
@@ -1,16 +1,16 @@
1
-
usecrate::{errors::*, indexes::*, request::*};
1
+
usecrate::{errors::*, indexes::*, request::*,Rc};
2
2
use serde_json::{json,Value};
3
3
use serde::{Deserialize};
4
4
use std::collections::HashMap;
5
5
6
6
/// The top-level struct of the SDK, representing a client containing [indexes](../indexes/struct.Index.html).
7
7
#[derive(Debug)]
8
-
pubstructClient<'a>{
9
-
pub(crate)host:&'astr,
10
-
pub(crate)apikey:&'astr,
8
+
pubstructClient{
9
+
pub(crate)host:Rc<String>,
10
+
pub(crate)api_key:Rc<String>,
11
11
}
12
12
13
-
impl<'a>Client<'a>{
13
+
implClient{
14
14
/// Create a client using the specified server.
15
15
/// Don't put a '/' at the end of the host.
16
16
/// In production mode, see [the documentation about authentication](https://docs.meilisearch.com/reference/features/authentication.html#authentication).
@@ -22,8 +22,11 @@ impl<'a> Client<'a> {
22
22
/// // create the client
23
23
/// let client = Client::new("http://localhost:7700", "masterKey");
Copy file name to clipboardExpand all lines: src/dumps.rs
+9-9Lines changed: 9 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -63,7 +63,7 @@ pub struct DumpInfo {
63
63
64
64
/// Dump related methods.\
65
65
/// See the [dumps](crate::dumps) module.
66
-
impl<'a>Client<'a>{
66
+
implClient{
67
67
/// Triggers a dump creation process.
68
68
/// Once the process is complete, a dump is created in the [dumps directory](https://docs.meilisearch.com/reference/features/configuration.html#dumps-destination).
69
69
/// If the dumps directory does not exist yet, it will be created.
0 commit comments