File tree Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Original file line number Diff line number Diff line change @@ -63,6 +63,38 @@ impl Client {
63
63
Ok ( indexes_results)
64
64
}
65
65
66
+ /// Return the host associated with this index.
67
+ ///
68
+ /// # Example
69
+ ///
70
+ /// ```
71
+ /// # use meilisearch_sdk::{client::*};
72
+ /// # let MEILISEARCH_API_KEY = option_env!("MEILISEARCH_API_KEY").unwrap_or("masterKey");
73
+ /// // create the client
74
+ /// let client = Client::new("http://doggo.dog", MEILISEARCH_API_KEY);
75
+ ///
76
+ /// assert_eq!(client.get_host(), "http://doggo.dog");
77
+ /// ```
78
+ pub fn get_host ( & self ) -> & str {
79
+ & self . host
80
+ }
81
+
82
+ /// Return the api key associated with this index.
83
+ ///
84
+ /// # Example
85
+ ///
86
+ /// ```
87
+ /// # use meilisearch_sdk::{client::*};
88
+ /// # let MEILISEARCH_URL = option_env!("MEILISEARCH_URL").unwrap_or("http://localhost:7700");
89
+ /// // create the client
90
+ /// let client = Client::new(MEILISEARCH_URL, "doggo");
91
+ ///
92
+ /// assert_eq!(client.get_api_key(), "doggo");
93
+ /// ```
94
+ pub fn get_api_key ( & self ) -> & str {
95
+ & self . api_key
96
+ }
97
+
66
98
/// List all [Index]es with query parameters and returns values as instances of [Index].
67
99
///
68
100
/// # Example
You can’t perform that action at this time.
0 commit comments