Trait SerializableRequest

Source
pub trait SerializableRequest {
    const OPCODE: RequestOpcode;

    // Required method
    fn serialize(
        &self,
        buf: &mut Vec<u8>,
    ) -> Result<(), CqlRequestSerializationError>;

    // Provided method
    fn to_bytes(&self) -> Result<Bytes, CqlRequestSerializationError> { ... }
}
Expand description

Requests that can be serialized into a CQL frame.

Required Associated Constants§

Source

const OPCODE: RequestOpcode

Opcode of the request, used to identify the request type in the CQL frame.

Required Methods§

Source

fn serialize( &self, buf: &mut Vec<u8>, ) -> Result<(), CqlRequestSerializationError>

Serializes the request into the provided buffer.

Provided Methods§

Source

fn to_bytes(&self) -> Result<Bytes, CqlRequestSerializationError>

Serializes the request into a heap-allocated Bytes object.

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§

Source§

impl SerializableRequest for AuthResponse

Source§

const OPCODE: RequestOpcode = RequestOpcode::AuthResponse

Source§

impl SerializableRequest for Execute<'_>

Source§

const OPCODE: RequestOpcode = RequestOpcode::Execute

Source§

impl SerializableRequest for Options

Source§

const OPCODE: RequestOpcode = RequestOpcode::Options

Source§

impl SerializableRequest for Prepare<'_>

Source§

const OPCODE: RequestOpcode = RequestOpcode::Prepare

Source§

impl SerializableRequest for Query<'_>

Source§

const OPCODE: RequestOpcode = RequestOpcode::Query

Source§

impl SerializableRequest for Register

Source§

const OPCODE: RequestOpcode = RequestOpcode::Register

Source§

impl SerializableRequest for Startup<'_>

Source§

const OPCODE: RequestOpcode = RequestOpcode::Startup

Source§

impl<Statement, Values> SerializableRequest for Batch<'_, Statement, Values>
where for<'s> BatchStatement<'s>: From<&'s Statement>, Statement: Clone, Values: RawBatchValues,

Source§

const OPCODE: RequestOpcode = RequestOpcode::Batch