Trait scylla::serialize::value::SerializeValue

source ·
pub trait SerializeValue {
    // Required method
    fn serialize<'b>(
        &self,
        typ: &ColumnType<'_>,
        writer: CellWriter<'b>,
    ) -> Result<WrittenCellProof<'b>, SerializationError>;
}
Expand description

A type that can be serialized and sent along with a CQL statement.

This is a low-level trait that is exposed to the specifics to the CQL protocol and usually does not have to be implemented directly. See the chapter on “Query Values” in the driver docs for information about how this trait is supposed to be used.

Required Methods§

source

fn serialize<'b>( &self, typ: &ColumnType<'_>, writer: CellWriter<'b>, ) -> Result<WrittenCellProof<'b>, SerializationError>

Serializes the value to given CQL type.

The value should produce a [value], according to the CQL protocol specification, containing the serialized value. See section 6 of the document on how the contents of the [value] should look like.

The value produced should match the type provided by typ. If the value cannot be serialized to that type, an error should be returned.

The CellWriter provided to the method ensures that the value produced will be properly framed (i.e. incorrectly written value should not cause the rest of the request to be misinterpreted), but otherwise the implementor of the trait is responsible for producing the value in a correct format.

Implementations on Foreign Types§

source§

impl SerializeValue for &str

source§

fn serialize<'b>( &self, typ: &ColumnType<'_>, writer: CellWriter<'b>, ) -> Result<WrittenCellProof<'b>, SerializationError>

source§

impl SerializeValue for &[u8]

source§

fn serialize<'b>( &self, typ: &ColumnType<'_>, writer: CellWriter<'b>, ) -> Result<WrittenCellProof<'b>, SerializationError>

source§

impl SerializeValue for IpAddr

source§

fn serialize<'b>( &self, typ: &ColumnType<'_>, writer: CellWriter<'b>, ) -> Result<WrittenCellProof<'b>, SerializationError>

source§

impl SerializeValue for bool

source§

fn serialize<'b>( &self, typ: &ColumnType<'_>, writer: CellWriter<'b>, ) -> Result<WrittenCellProof<'b>, SerializationError>

source§

impl SerializeValue for f32

source§

fn serialize<'b>( &self, typ: &ColumnType<'_>, writer: CellWriter<'b>, ) -> Result<WrittenCellProof<'b>, SerializationError>

source§

impl SerializeValue for f64

source§

fn serialize<'b>( &self, typ: &ColumnType<'_>, writer: CellWriter<'b>, ) -> Result<WrittenCellProof<'b>, SerializationError>

source§

impl SerializeValue for i8

source§

fn serialize<'b>( &self, typ: &ColumnType<'_>, writer: CellWriter<'b>, ) -> Result<WrittenCellProof<'b>, SerializationError>

source§

impl SerializeValue for i16

source§

fn serialize<'b>( &self, typ: &ColumnType<'_>, writer: CellWriter<'b>, ) -> Result<WrittenCellProof<'b>, SerializationError>

source§

impl SerializeValue for i32

source§

fn serialize<'b>( &self, typ: &ColumnType<'_>, writer: CellWriter<'b>, ) -> Result<WrittenCellProof<'b>, SerializationError>

source§

impl SerializeValue for i64

source§

fn serialize<'b>( &self, typ: &ColumnType<'_>, writer: CellWriter<'b>, ) -> Result<WrittenCellProof<'b>, SerializationError>

source§

impl SerializeValue for Uuid

source§

fn serialize<'b>( &self, typ: &ColumnType<'_>, writer: CellWriter<'b>, ) -> Result<WrittenCellProof<'b>, SerializationError>

source§

impl SerializeValue for String

source§

fn serialize<'b>( &self, typ: &ColumnType<'_>, writer: CellWriter<'b>, ) -> Result<WrittenCellProof<'b>, SerializationError>

source§

impl SerializeValue for Vec<u8>

source§

fn serialize<'b>( &self, typ: &ColumnType<'_>, writer: CellWriter<'b>, ) -> Result<WrittenCellProof<'b>, SerializationError>

source§

impl<'a, T> SerializeValue for &'a [T]
where T: SerializeValue + 'a,

source§

fn serialize<'b>( &self, typ: &ColumnType<'_>, writer: CellWriter<'b>, ) -> Result<WrittenCellProof<'b>, SerializationError>

source§

impl<K, V> SerializeValue for BTreeMap<K, V>

source§

fn serialize<'b>( &self, typ: &ColumnType<'_>, writer: CellWriter<'b>, ) -> Result<WrittenCellProof<'b>, SerializationError>

source§

impl<K, V, S> SerializeValue for HashMap<K, V, S>

source§

fn serialize<'b>( &self, typ: &ColumnType<'_>, writer: CellWriter<'b>, ) -> Result<WrittenCellProof<'b>, SerializationError>

source§

impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> SerializeValue for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15)

source§

fn serialize<'b>( &self, typ: &ColumnType<'_>, writer: CellWriter<'b>, ) -> Result<WrittenCellProof<'b>, SerializationError>

source§

impl<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> SerializeValue for (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15)

source§

fn serialize<'b>( &self, typ: &ColumnType<'_>, writer: CellWriter<'b>, ) -> Result<WrittenCellProof<'b>, SerializationError>

source§

impl<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> SerializeValue for (T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15)

source§

fn serialize<'b>( &self, typ: &ColumnType<'_>, writer: CellWriter<'b>, ) -> Result<WrittenCellProof<'b>, SerializationError>

source§

impl<T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> SerializeValue for (T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15)

source§

fn serialize<'b>( &self, typ: &ColumnType<'_>, writer: CellWriter<'b>, ) -> Result<WrittenCellProof<'b>, SerializationError>

source§

impl<T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> SerializeValue for (T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15)

source§

fn serialize<'b>( &self, typ: &ColumnType<'_>, writer: CellWriter<'b>, ) -> Result<WrittenCellProof<'b>, SerializationError>

source§

impl<T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> SerializeValue for (T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15)

source§

fn serialize<'b>( &self, typ: &ColumnType<'_>, writer: CellWriter<'b>, ) -> Result<WrittenCellProof<'b>, SerializationError>

source§

impl<T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> SerializeValue for (T6, T7, T8, T9, T10, T11, T12, T13, T14, T15)

source§

fn serialize<'b>( &self, typ: &ColumnType<'_>, writer: CellWriter<'b>, ) -> Result<WrittenCellProof<'b>, SerializationError>

source§

impl<T7, T8, T9, T10, T11, T12, T13, T14, T15> SerializeValue for (T7, T8, T9, T10, T11, T12, T13, T14, T15)

source§

fn serialize<'b>( &self, typ: &ColumnType<'_>, writer: CellWriter<'b>, ) -> Result<WrittenCellProof<'b>, SerializationError>

source§

impl<T8, T9, T10, T11, T12, T13, T14, T15> SerializeValue for (T8, T9, T10, T11, T12, T13, T14, T15)

source§

fn serialize<'b>( &self, typ: &ColumnType<'_>, writer: CellWriter<'b>, ) -> Result<WrittenCellProof<'b>, SerializationError>

source§

impl<T9, T10, T11, T12, T13, T14, T15> SerializeValue for (T9, T10, T11, T12, T13, T14, T15)

source§

fn serialize<'b>( &self, typ: &ColumnType<'_>, writer: CellWriter<'b>, ) -> Result<WrittenCellProof<'b>, SerializationError>

source§

impl<T10, T11, T12, T13, T14, T15> SerializeValue for (T10, T11, T12, T13, T14, T15)

source§

fn serialize<'b>( &self, typ: &ColumnType<'_>, writer: CellWriter<'b>, ) -> Result<WrittenCellProof<'b>, SerializationError>

source§

impl<T11, T12, T13, T14, T15> SerializeValue for (T11, T12, T13, T14, T15)

source§

fn serialize<'b>( &self, typ: &ColumnType<'_>, writer: CellWriter<'b>, ) -> Result<WrittenCellProof<'b>, SerializationError>

source§

impl<T12, T13, T14, T15> SerializeValue for (T12, T13, T14, T15)

source§

fn serialize<'b>( &self, typ: &ColumnType<'_>, writer: CellWriter<'b>, ) -> Result<WrittenCellProof<'b>, SerializationError>

source§

impl<T13, T14, T15> SerializeValue for (T13, T14, T15)

source§

fn serialize<'b>( &self, typ: &ColumnType<'_>, writer: CellWriter<'b>, ) -> Result<WrittenCellProof<'b>, SerializationError>

source§

impl<T14, T15> SerializeValue for (T14, T15)
where T14: SerializeValue, T15: SerializeValue,

source§

fn serialize<'b>( &self, typ: &ColumnType<'_>, writer: CellWriter<'b>, ) -> Result<WrittenCellProof<'b>, SerializationError>

source§

impl<T15> SerializeValue for (T15,)
where T15: SerializeValue,

source§

fn serialize<'b>( &self, typ: &ColumnType<'_>, writer: CellWriter<'b>, ) -> Result<WrittenCellProof<'b>, SerializationError>

source§

impl<T> SerializeValue for Option<T>
where T: SerializeValue,

source§

fn serialize<'b>( &self, typ: &ColumnType<'_>, writer: CellWriter<'b>, ) -> Result<WrittenCellProof<'b>, SerializationError>

source§

impl<T> SerializeValue for &T
where T: SerializeValue + ?Sized,

source§

fn serialize<'b>( &self, typ: &ColumnType<'_>, writer: CellWriter<'b>, ) -> Result<WrittenCellProof<'b>, SerializationError>

source§

impl<T> SerializeValue for Box<T>
where T: SerializeValue + ?Sized,

source§

fn serialize<'b>( &self, typ: &ColumnType<'_>, writer: CellWriter<'b>, ) -> Result<WrittenCellProof<'b>, SerializationError>

source§

impl<T> SerializeValue for Vec<T>
where T: SerializeValue,

source§

fn serialize<'b>( &self, typ: &ColumnType<'_>, writer: CellWriter<'b>, ) -> Result<WrittenCellProof<'b>, SerializationError>

source§

impl<V> SerializeValue for BTreeSet<V>
where V: SerializeValue,

source§

fn serialize<'b>( &self, typ: &ColumnType<'_>, writer: CellWriter<'b>, ) -> Result<WrittenCellProof<'b>, SerializationError>

source§

impl<V, S> SerializeValue for HashSet<V, S>

source§

fn serialize<'b>( &self, typ: &ColumnType<'_>, writer: CellWriter<'b>, ) -> Result<WrittenCellProof<'b>, SerializationError>

source§

impl<const N: usize> SerializeValue for [u8; N]

source§

fn serialize<'b>( &self, typ: &ColumnType<'_>, writer: CellWriter<'b>, ) -> Result<WrittenCellProof<'b>, SerializationError>

Implementors§