diff --git a/docs/source/migration-guides/0.11-serialization.md b/docs/source/migration-guides/0.11-serialization.md index 1f7729dbd4..4df222592c 100644 --- a/docs/source/migration-guides/0.11-serialization.md +++ b/docs/source/migration-guides/0.11-serialization.md @@ -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>; @@ -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)]