Repository: unum-cloud/usearch (language: rust)

Issue:
Docs: The usearch.h exact_search documentation doesn't match the function arguments
### Describe the bug

The usearch.h exact_search documentation doesn't match the function arguments

```
/**
 *  @brief Multi-threaded exact nearest neighbors search for equi-dimensional vectors.
 *  @param[in] dataset Pointer to the first scalar of the dataset matrix.
 *  @param[in] queries Pointer to the first scalar of the queries matrix.
 *  @param[in] dataset_size Number of vectors in the `dataset`.
 *  @param[in] queries_size Number of vectors in the `queries` set.
 *  @param[in] dataset_stride Number of bytes between starts of consecutive vectors in `dataset`.
 *  @param[in] queries_stride Number of bytes between starts of consecutive vectors in `queries`.
 *  @param[in] scalar_kind The scalar type used in the vectors.
 *  @param[in] dimensions The number of dimensions in each vector.
 *  @param[in] metric_kind The metric kind used for distance calculation between vectors.
 *  @param[in] count Upper bound on the number of neighbors to search, the "k" in "kANN".
 *  @param[in] threads Upper bound for the number of CPU threads to use.
 *  @param[out] keys Output buffer for up to `count` nearest neighbors keys.
 *  @param[out] distances Output buffer for up to `count` distances to nearest neighbors.
 *  @param[out] error Pointer to a string where the error message will be stored, if an error occurs.
 *  @return Number of found matches.
 */
USEARCH_EXPORT void usearch_exact_search(                            //
    void const* dataset, size_t dataset_size, size_t dataset_stride, //
    void const* queries, size_t queries_size, size_t queries_stride, //
    usearch_scalar_kind_t scalar_kind, size_t dimensions,            //
    usearch_metric_kind_t metric_kind, size_t count, size_t threads, //
    usearch_key_t* keys, size_t keys_stride,                         //
    usearch_distance_t* distances, size_t distances_stride,          //
    usearch_error_t* error);
```

### Steps to reproduce

-

### Expected behavior

-

### USearch version

main-dev

### Operating System

Ubuntu 24

### Hardware architecture

x86

### Which interface are you using?

C++ implementation

### Contact Details

_No response_

### Are you open to being tagged as a contributor?

- [X] I am open to being mentioned in the project `.git` history as a contributor

### Is there an existing issue for this?

- [X] I have searched the existing issues

### Code of Conduct

- [X] I agree to follow this project's Code of Conduct


Discussion / hints:
Under python/  index.search has an unused and undocumented argument radius

```
def search(
        self,
        vectors: VectorOrVectorsLike,
        count: int = 10,
        radius: float = math.inf,
```
Yes, @MarkReedZ, it has :) I was just discussing it with someone on a phone. Will think about implementing it in the engine 🤗 

Fix patch:
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 144eb476..c128da8a 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -26,11 +26,6 @@ jobs:
         with:
           fetch-depth: 0
           persist-credentials: false
-      - name: Set up Cargo
-        uses: actions-rs/toolchain@v1
-        with:
-          toolchain: stable
-          override: true
       - name: Run TinySemVer
         uses: ashvardanian/tinysemver@v2.0.1
         with:
@@ -40,6 +35,7 @@ jobs:
             package.json:"version": "(\d+\.\d+\.\d+)"
             CITATION.cff:^version: (\d+\.\d+\.\d+)
             Cargo.toml:^version = "(\d+\.\d+\.\d+)"
+            Cargo.lock:^version = "(\d+\.\d+\.\d+)"
             wasmer.toml:^version = "(\d+\.\d+\.\d+)"
             conanfile.py:version = "(\d+\.\d+\.\d+)"
             java/README.md:<version>(\d+\.\d+\.\d+)</version>
diff --git a/Cargo.lock b/Cargo.lock
index 36d1079d..74494b1c 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -135,7 +135,7 @@ checksum = "68f5e5f3158ecfd4b8ff6fe086db7c8467a2dfdac97fe420f2b7c4aa97af66d6"
 
 [[package]]
 name = "usearch"
-version = "2.13.0"
+version = "2.13.1"
 dependencies = [
  "cxx",
  "cxx-build",
diff --git a/README.md b/README.md
index f54cd780..2dcc11ce 100644
--- a/README.md
+++ b/README.md
@@ -400,7 +400,7 @@ def search(query: str) -> np.ndarray:
 server.run()
 ```
 
-Similar experiences can also be imlemented in other languages and on the client side, removing the network latency.
+Similar experiences can also be implemented in other languages and on the client side, removing the network latency.
 For Swift and iOS, check out the [`ashvardanian/SwiftSemanticSearch`](https://github.com/ashvardanian/SwiftSemanticSearch) repository.
 
 <table>
diff --git a/c/usearch.h b/c/usearch.h
index 0acce530..743d49cc 100644
--- a/c/usearch.h
+++ b/c/usearch.h
@@ -434,7 +434,7 @@ USEARCH_EXPORT usearch_distance_t usearch_distance(       //
     usearch_metric_kind_t metric_kind, usearch_error_t* error);
 
 /**
- *  @brief Multi-threaded exact nearest neighbors search for equi-dimensional vectors.
+ *  @brief Multi-threaded many-to-many exact nearest neighbors search for equi-dimensional vectors.
  *  @param[in] dataset Pointer to the first scalar of the dataset matrix.
  *  @param[in] queries Pointer to the first scalar of the queries matrix.
  *  @param[in] dataset_size Number of vectors in the `dataset`.
@@ -446,10 +446,13 @@ USEARCH_EXPORT usearch_distance_t usearch_distance(       //
  *  @param[in] metric_kind The metric kind used for distance calculation between vectors.
  *  @param[in] count Upper bound on the number of neighbors to search, the "k" in "kANN".
  *  @param[in] threads Upper bound for the number of CPU threads to use.
- *  @param[out] keys Output buffer for up to `count` nearest neighbors keys.
- *  @param[out] distances Output buffer for up to `count` distances to nearest neighbors.
+ *  @param[out] keys Output matrix for `queries_size * count` nearest neighbors keys. Each row of the
+ *              matrix must be contiguous in memory, but different rows can be separated by `keys_stride` bytes.
+ *  @param[in] keys_stride Number of bytes between starts of consecutive rows od scalars in `keys`.
+ *  @param[out] distances Output matrix for `queries_size * count` distances to nearest neighbors. Each row of the
+ *              matrix must be contiguous in memory, but different rows can be separated by `keys_stride` bytes.
+ *  @param[in] distances_stride Number of bytes between starts of consecutive rows od scalars in `distances`.
  *  @param[out] error Pointer to a string where the error message will be stored, if an error occurs.
- *  @return Number of found matches.
  */
 USEARCH_EXPORT void usearch_exact_search(                            //
     void const* dataset, size_t dataset_size, size_t dataset_stride, //
diff --git a/java/cloud/unum/usearch/Index.java b/java/cloud/unum/usearch/Index.java
index c6de074f..173c1762 100644
--- a/java/cloud/unum/usearch/Index.java
+++ b/java/cloud/unum/usearch/Index.java
@@ -176,7 +176,7 @@ public int[] search(float vector[], long count) {
    *
    * @param key key to lookup.
    * @return the contents of the vector.
-   * @throws linkIllegalArgumentException} is key is not available.
+   * @throws IllegalArgumentException is key is not available.
    */
   public float[] get(int key) {
     if (c_ptr == 0) {
diff --git a/java/cloud/unum/usearch/cloud_unum_usearch_Index.cpp b/java/cloud/unum/usearch/cloud_unum_usearch_Index.cpp
index 995b7343..cf96521d 100644
--- a/java/cloud/unum/usearch/cloud_unum_usearch_Index.cpp
+++ b/java/cloud/unum/usearch/cloud_unum_usearch_Index.cpp
@@ -60,7 +60,8 @@ JNIEXPORT jlong JNICALL Java_cloud_unum_usearch_Index_c_1create( //
     return result;
 }
 
-JNIEXPORT jlong JNICALL Java_cloud_unum_usearch_Index_c_1createFromFile(JNIEnv *env, jclass, jstring path, jboolean view) {
+JNIEXPORT jlong JNICALL Java_cloud_unum_usearch_Index_c_1createFromFile(JNIEnv* env, jclass, jstring path,
+                                                                        jboolean view) {
     char const* path_cstr = env->GetStringUTFChars(path, 0);
     index_dense_t::state_result_t make_result = index_dense_t::make(path_cstr, view);
     env->ReleaseStringUTFChars(path, path_cstr);
@@ -157,9 +158,8 @@ JNIEXPORT void JNICALL Java_cloud_unum_usearch_Index_c_1add( //
     (*env).ReleaseFloatArrayElements(vector, vector_data, 0);
 }
 
-JNIEXPORT jfloatArray JNICALL Java_cloud_unum_usearch_Index_c_1get(
-    JNIEnv *env, jclass, jlong c_ptr, jint key) {
-    
+JNIEXPORT jfloatArray JNICALL Java_cloud_unum_usearch_Index_c_1get(JNIEnv* env, jclass, jlong c_ptr, jint key) {
+
     auto index = reinterpret_cast<index_dense_t*>(c_ptr);
     size_t dim = index->dimensions();
     std::unique_ptr<jfloat[]> vector(new jfloat[dim]);
@@ -170,7 +170,7 @@ JNIEXPORT jfloatArray JNICALL Java_cloud_unum_usearch_Index_c_1get(
         }
     }
     jfloatArray jvector = env->NewFloatArray(dim);
-    if (jvector == nullptr) {  // out of memory
+    if (jvector == nullptr) { // out of memory
         return nullptr;
     }
     env->SetFloatArrayRegion(jvector, 0, dim, vector.get());
diff --git a/rust/lib.cpp b/rust/lib.cpp
index 60e7a2e9..b480a596 100644
--- a/rust/lib.cpp
+++ b/rust/lib.cpp
@@ -177,5 +177,9 @@ std::unique_ptr<NativeIndex> new_native_index(IndexOptions const& options) {
         throw std::invalid_argument("Unsupported metric or scalar type");
     index_dense_config_t config(options.connectivity, options.expansion_add, options.expansion_search);
     config.multi = options.multi;
-    return wrap(index_t::make(metric, config));
+    index_t index = index_t::make(metric, config);
+    // In Rust we have the luxury of returning a `Result` type even for the constructor.
+    // So let's pre-reserve the maximal number of threads and return the error if it fails.
+    index.reserve(index_limits_t{});
+    return wrap(std::move(index));
 }
diff --git a/rust/lib.hpp b/rust/lib.hpp
index a810d347..ba7f3fe4 100644
--- a/rust/lib.hpp
+++ b/rust/lib.hpp
@@ -1,7 +1,7 @@
 #pragma once
 #include "rust/cxx.h"
 
-// We don't have to forward decalre all of those:
+// We don't have to forward declare all of those:
 struct Matches;
 struct IndexOptions;
 enum class MetricKind;


Test patch: