Skip to main content

FixedWireSize

Trait FixedWireSize 

Source
pub trait FixedWireSize {
    const WIRE_SIZE: usize;
}
Expand description

Marker trait for types with a fixed wire size in MySQL binary protocol.

This trait is only implemented for types that have a guaranteed fixed size on the wire. Native integer types like i64 are NOT implemented because MySQL uses little-endian encoding, which differs from native byte order on big-endian platforms.

Use zerocopy’s little-endian types instead:

  • zerocopy::little_endian::I16 instead of i16
  • zerocopy::little_endian::I32 instead of i32
  • zerocopy::little_endian::I64 instead of i64
  • etc.

Required Associated Constants§

Source

const WIRE_SIZE: usize

The fixed size in bytes on the wire.

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 FixedWireSize for i8

Source§

impl FixedWireSize for u8

Implementors§