From 358814cbfae3e27e39cef020dccdd5d2c0505739 Mon Sep 17 00:00:00 2001 From: muzarski Date: Wed, 3 Jan 2024 12:26:19 +0100 Subject: [PATCH] docs: update info about varint native data type --- docs/source/data-types/data-types.md | 2 +- docs/source/data-types/varint.md | 13 ++++++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/docs/source/data-types/data-types.md b/docs/source/data-types/data-types.md index f9fae6cedf..e03c82233e 100644 --- a/docs/source/data-types/data-types.md +++ b/docs/source/data-types/data-types.md @@ -27,7 +27,7 @@ Database types and their Rust equivalents: * `Timestamp` <----> `value::CqlTimestamp`, `chrono::DateTime`, `time::OffsetDateTime` * `Duration` <----> `value::CqlDuration` * `Decimal` <----> `bigdecimal::Decimal` -* `Varint` <----> `num_bigint::BigInt` +* `Varint` <----> `value::CqlVarint`, `num_bigint::BigInt` (v0.3 and v0.4) * `List` <----> `Vec` * `Set` <----> `Vec` * `Map` <----> `std::collections::HashMap` diff --git a/docs/source/data-types/varint.md b/docs/source/data-types/varint.md index b90c9a5ccb..745520e66f 100644 --- a/docs/source/data-types/varint.md +++ b/docs/source/data-types/varint.md @@ -1,5 +1,16 @@ # Varint -`Varint` is represented as [`num_bigint::BigInt`](https://docs.rs/num-bigint/0.4.0/num_bigint/struct.BigInt.html) +`Varint` is represented as `value::CqlVarint` or [`num_bigint::BigInt`](https://docs.rs/num-bigint/0.4.0/num_bigint/struct.BigInt.html). + +## num_bigint::BigInt + +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. + +## value::CqlVarint + +Without any feature flags, the user can interact with `Varint` type by making use of `value::CqlVarint` which +is a very simple wrapper representing the value as signed binary number in big-endian order. + +## Example ```rust # extern crate scylla;