Skip to main content

FixedSize

Trait FixedSize 

Source
pub trait FixedSize:
    Sized
    + Clone
    + Send
    + Sync
    + 'static {
    // Required methods
    fn read_from(buffer: &mut &[u8]) -> Result<Self>;
    fn write_to(&self, buffer: &mut BytesMut);
}
Expand description

Trait for types that can be read/written as fixed-size values (synchronous version for columns)

All numeric types are stored in little-endian format in ClickHouse wire protocol.

Required Methods§

Source

fn read_from(buffer: &mut &[u8]) -> Result<Self>

Read a single fixed-size value from the buffer in little-endian byte order.

Source

fn write_to(&self, buffer: &mut BytesMut)

Write a single fixed-size value to the buffer in little-endian byte order.

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.

Implementations on Foreign Types§

Source§

impl FixedSize for f32

Source§

fn read_from(buffer: &mut &[u8]) -> Result<Self>

Source§

fn write_to(&self, buffer: &mut BytesMut)

Source§

impl FixedSize for f64

Source§

fn read_from(buffer: &mut &[u8]) -> Result<Self>

Source§

fn write_to(&self, buffer: &mut BytesMut)

Source§

impl FixedSize for i8

Source§

fn read_from(buffer: &mut &[u8]) -> Result<Self>

Source§

fn write_to(&self, buffer: &mut BytesMut)

Source§

impl FixedSize for i16

Source§

fn read_from(buffer: &mut &[u8]) -> Result<Self>

Source§

fn write_to(&self, buffer: &mut BytesMut)

Source§

impl FixedSize for i32

Source§

fn read_from(buffer: &mut &[u8]) -> Result<Self>

Source§

fn write_to(&self, buffer: &mut BytesMut)

Source§

impl FixedSize for i64

Source§

fn read_from(buffer: &mut &[u8]) -> Result<Self>

Source§

fn write_to(&self, buffer: &mut BytesMut)

Source§

impl FixedSize for i128

Source§

fn read_from(buffer: &mut &[u8]) -> Result<Self>

Source§

fn write_to(&self, buffer: &mut BytesMut)

Source§

impl FixedSize for u8

Source§

fn read_from(buffer: &mut &[u8]) -> Result<Self>

Source§

fn write_to(&self, buffer: &mut BytesMut)

Source§

impl FixedSize for u16

Source§

fn read_from(buffer: &mut &[u8]) -> Result<Self>

Source§

fn write_to(&self, buffer: &mut BytesMut)

Source§

impl FixedSize for u32

Source§

fn read_from(buffer: &mut &[u8]) -> Result<Self>

Source§

fn write_to(&self, buffer: &mut BytesMut)

Source§

impl FixedSize for u64

Source§

fn read_from(buffer: &mut &[u8]) -> Result<Self>

Source§

fn write_to(&self, buffer: &mut BytesMut)

Source§

impl FixedSize for u128

Source§

fn read_from(buffer: &mut &[u8]) -> Result<Self>

Source§

fn write_to(&self, buffer: &mut BytesMut)

Implementors§