# Rust Client API 0.2.0

**URL:** https://forums.foundationdb.org/t/rust-client-api-0-2-0/386
**Category:** Development
**Tags:** bindings
**Created:** [May 9, 2018, 1:57pm UTC](https://forums.foundationdb.org/t/rust-client-api-0-2-0/386 "2018-05-09T13:57:29Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![bluejekyll](https://sea1.discourse-cdn.com/foundationdb/user_avatar/forums.foundationdb.org/bluejekyll/32/195_2.png) [@bluejekyll](https://forums.foundationdb.org/u/bluejekyll)
#### Post date: [May 9, 2018, 1:57pm UTC](https://forums.foundationdb.org/t/rust-client-api-0-2-0/386/1 "2018-05-09T13:57:30Z")

</div>

This is a cross-post from the Rust Users forum:

> **[FoundationDB Rust client API 0.2.0](https://users.rust-lang.org/t/foundationdb-rust-client-api-0-2-0/17019/4)**
>
> I’m happy to announce that we’ve got a 0.2 release of the API complete. Again, much of the low level work was completed by @yjh0502, see the changelog below for all the APIs added. This release also brings the implementations for Tuple::{decode,...

The highlights are the integration with the bindingstester and benchmark test suites, as well as native bindings for `Tuple` to native Rust tuples.

Feedback is of course welcome, Thanks!

---

<div class="post-metadata">

### Author: ![amirouche](https://sea1.discourse-cdn.com/foundationdb/user_avatar/forums.foundationdb.org/amirouche/32/2096_2.png) [@amirouche](https://forums.foundationdb.org/u/amirouche)
#### Post date: [May 10, 2018, 8:39pm UTC](https://forums.foundationdb.org/t/rust-client-api-0-2-0/386/2 "2018-05-10T20:39:57Z")

</div>

Do you use rust [bytekey](https://github.com/danburkert/bytekey) or do you use the same lexicographic encoding than Python? Actually, I am not sure if encodings are interoperable across bindings.

---

<div class="post-metadata">

### Author: ![bluejekyll](https://sea1.discourse-cdn.com/foundationdb/user_avatar/forums.foundationdb.org/bluejekyll/32/195_2.png) [@bluejekyll](https://forums.foundationdb.org/u/bluejekyll)
#### Post date: [May 18, 2018, 1:55pm UTC](https://forums.foundationdb.org/t/rust-client-api-0-2-0/386/3 "2018-05-18T13:55:15Z")

</div>

Sorry for the late reply. The formats for the packed keys should be compatible across implementations. We did notice that Python appears to convert strings to byte fields rather than storing as strings in the packed key. We weren’t clear about why that was.

This Rust impl should properly encode everything in a portable manner. It would be a bug if not.

---

<div class="post-metadata">

### Author: ![ajbeamon](https://sea1.discourse-cdn.com/foundationdb/user_avatar/forums.foundationdb.org/ajbeamon/32/13_2.png) [@ajbeamon](https://forums.foundationdb.org/u/ajbeamon)
#### Post date: [May 18, 2018, 2:14pm UTC](https://forums.foundationdb.org/t/rust-client-api-0-2-0/386/4 "2018-05-18T14:14:19Z")

</div>

> [@bluejekyll](#):
>
> We did notice that Python appears to convert strings to byte fields rather than storing as strings in the packed key. We weren’t clear about why that was.

The types supported in the Tuple layer include both byte strings and Unicode strings. The Python 2 string type (`str`) stores raw byte strings and so is packed as byte strings in the Tuple layer. To get Unicode strings you would need to use the `unicode` type (e.g. by using `u'foo'` for string literals).

In Python 3 the situation is reversed, as the `str` type now represents Unicode strings and you need to use the `bytes` type for byte strings (e.g. `b'foo'` for byte literals).

---

<div class="post-metadata">

### Author: ![amirouche](https://sea1.discourse-cdn.com/foundationdb/user_avatar/forums.foundationdb.org/amirouche/32/2096_2.png) [@amirouche](https://forums.foundationdb.org/u/amirouche)
#### Post date: [May 18, 2018, 6:57pm UTC](https://forums.foundationdb.org/t/rust-client-api-0-2-0/386/5 "2018-05-18T18:57:31Z")

</div>

There is bug in the tracker to replace all `'strings'` with `b'bytes'` but I did not come up with motivation to do it.

Also, I am investigating how to add a layer in [my database zehefyu93](https://github.com/amirouche/zehefyu93) to be able to use both wiredtiger and foundationdb. Actually, to be able to replace one with the other. An abstraction, already!

It’s unlikely that I will pick up the work on asyncio bindings. I tried to add some comments!

---

<div class="post-metadata">

### Author: ![ajbeamon](https://sea1.discourse-cdn.com/foundationdb/user_avatar/forums.foundationdb.org/ajbeamon/32/13_2.png) [@ajbeamon](https://forums.foundationdb.org/u/ajbeamon)
#### Post date: [May 18, 2018, 7:15pm UTC](https://forums.foundationdb.org/t/rust-client-api-0-2-0/386/6 "2018-05-18T19:15:27Z")

</div>

> [@amirouche](#):
>
> There is bug in the tracker to replace all ‘strings’ with b’bytes’ but I did not come up with motivation to do it.

To be clear, I think the issue that @amirouche is referring to is that the documentation and examples are written assuming Python 2 syntax in some places. Using `b'bytes'` works in both versions and so would be preferable. See [Documentation: Promote Python 3 syntax for bytes · Issue #329 · apple/foundationdb · GitHub](https://github.com/apple/foundationdb/issues/329).

---

<div class="post-metadata">

### Author: ![amirouche](https://sea1.discourse-cdn.com/foundationdb/user_avatar/forums.foundationdb.org/amirouche/32/2096_2.png) [@amirouche](https://forums.foundationdb.org/u/amirouche)
#### Post date: [July 11, 2018, 6:44pm UTC](https://forums.foundationdb.org/t/rust-client-api-0-2-0/386/7 "2018-07-11T18:44:03Z")

</div>

Sorry for not being clear.
