Skip to content

Commit

Permalink
Docs: Fix code blocks in migration guide
Browse files Browse the repository at this point in the history
  • Loading branch information
Lorak-mmk committed Dec 19, 2023
1 parent 724698e commit 0338675
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions docs/source/migration-guides/0.11-serialization.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ When executing a statement through the CQL protocol, values for the bind markers
Before 0.11, the driver couldn't do this kind of type checking. For example, in the case of non-batch queries, the only information about the user data it has is that it implements `ValueList` - defined as follows:

```rust
# extern crate scylla;
# extern crate bytes;
# use scylla::frame::value::{SerializedResult, SerializeValuesError};
# use bytes::BufMut;

pub trait ValueList {
fn serialized(&self) -> SerializedResult<'_>;
fn write_to_request(&self, buf: &mut impl BufMut) -> Result<(), SerializeValuesError>;
Expand Down Expand Up @@ -42,6 +47,9 @@ By default, the `SerializeRow` and `SerializeCql` **will match the fields in the
In order to bring the old behavior to the new macros (the only difference being type checking which cannot be disabled right now) you can configure it using attributes, as shown in the snippet below:

```rust
# extern crate scylla;
use scylla::SerializeCql;

// The exact same attributes apply to the `SerializeRow` macro and their
// effect is completely analogous.
#[derive(SerializeCql)]
Expand Down

0 comments on commit 0338675

Please sign in to comment.