Trait CqlType

Source
pub trait CqlType {
    type ValueType;

    const VALUE_SIZE: usize;
}
Expand description

The base CQL Value Type

All read/writable types to a CQL Database should derive from this.

§Examples

This declares a CQL Type to read/write Strings of a maximum length of 255 bytes from the database:

pub struct TinyText;

impl CqlType for TinyText {
    type ValueType = String;
    const VALUE_SIZE: usize = 255;
}

Required Associated Constants§

Source

const VALUE_SIZE: usize

The (maximum) size of the value to read/write from the database.

Required Associated Types§

Source

type ValueType

The type of value to read/write from the database.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§