Skip to content

Commit 358814c

Browse files
committed
docs: update info about varint native data type
1 parent 81c5867 commit 358814c

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ Database types and their Rust equivalents:
2727
* `Timestamp` <----> `value::CqlTimestamp`, `chrono::DateTime<Utc>`, `time::OffsetDateTime`
2828
* `Duration` <----> `value::CqlDuration`
2929
* `Decimal` <----> `bigdecimal::Decimal`
30-
* `Varint` <----> `num_bigint::BigInt`
30+
* `Varint` <----> `value::CqlVarint`, `num_bigint::BigInt` (v0.3 and v0.4)
3131
* `List` <----> `Vec<T>`
3232
* `Set` <----> `Vec<T>`
3333
* `Map` <----> `std::collections::HashMap<K, V>`

docs/source/data-types/varint.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
# Varint
2-
`Varint` is represented as [`num_bigint::BigInt`](https://docs.rs/num-bigint/0.4.0/num_bigint/struct.BigInt.html)
2+
`Varint` is represented as `value::CqlVarint` or [`num_bigint::BigInt`](https://docs.rs/num-bigint/0.4.0/num_bigint/struct.BigInt.html).
3+
4+
## num_bigint::BigInt
5+
6+
To make use of `num_bigint::BigInt` type, user should enable one of the available feature flags (`num-bigint-03` or `num-bigint-04`). They enable support for `num_bigint::BigInt` v0.3 and v0.4 accordingly.
7+
8+
## value::CqlVarint
9+
10+
Without any feature flags, the user can interact with `Varint` type by making use of `value::CqlVarint` which
11+
is a very simple wrapper representing the value as signed binary number in big-endian order.
12+
13+
## Example
314

415
```rust
516
# extern crate scylla;

0 commit comments

Comments
 (0)