Skip to content

Commit 3cf3bf2

Browse files
committed
docs: update blob data type available conversions
Slice and array had been omitted from the documentation, so they are added now. Also, the `Bytes` type is added as a conversion for `Blob`, following the previous commit's change to support it.
1 parent 65ae32a commit 3cf3bf2

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

docs/source/data-types/blob.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Blob
2-
`Blob` is represented as `Vec<u8>`
2+
`Blob` is represented as one of:
3+
- `&[u8]`,
4+
- `Vec<u8>`,
5+
- `bytes::Bytes`,
6+
- `[u8; N]` (only serialization supported).
37

48

59
```rust
@@ -26,4 +30,4 @@ while let Some((blob_value,)) = stream.try_next().await? {
2630
}
2731
# Ok(())
2832
# }
29-
```
33+
```

docs/source/data-types/data-types.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Database types and their Rust equivalents:
1818
* `Double` <----> `f64`
1919
* `Ascii`, `Text`, `Varchar` <----> `&str`, `String`, `Box<str>`, `Arc<str>`
2020
* `Counter` <----> `value::Counter`
21-
* `Blob` <----> `Vec<u8>`
21+
* `Blob` <----> `&[u8]`, `Vec<u8>`, `Bytes`, (and `[u8; N]` for serialization only)
2222
* `Inet` <----> `std::net::IpAddr`
2323
* `Uuid` <----> `uuid::Uuid`
2424
* `Timeuuid` <----> `value::CqlTimeuuid`

0 commit comments

Comments
 (0)