arrow_json::writer::encoder

Trait PrimitiveEncode

Source
trait PrimitiveEncode: ArrowNativeType {
    type Buffer;

    // Required methods
    fn init_buffer() -> Self::Buffer;
    fn encode(self, buf: &mut Self::Buffer) -> &[u8] ;
}

Required Associated Types§

Required Methods§

Source

fn init_buffer() -> Self::Buffer

Source

fn encode(self, buf: &mut Self::Buffer) -> &[u8]

Encode the primitive value as bytes, returning a reference to that slice.

buf is temporary space that may be used

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 PrimitiveEncode for f32

Source§

type Buffer = [u8; 64]

Source§

fn init_buffer() -> Self::Buffer

Source§

fn encode(self, buf: &mut Self::Buffer) -> &[u8]

Source§

impl PrimitiveEncode for f64

Source§

type Buffer = [u8; 64]

Source§

fn init_buffer() -> Self::Buffer

Source§

fn encode(self, buf: &mut Self::Buffer) -> &[u8]

Source§

impl PrimitiveEncode for i8

Source§

type Buffer = [u8; 4]

Source§

fn init_buffer() -> Self::Buffer

Source§

fn encode(self, buf: &mut Self::Buffer) -> &[u8]

Source§

impl PrimitiveEncode for i16

Source§

type Buffer = [u8; 6]

Source§

fn init_buffer() -> Self::Buffer

Source§

fn encode(self, buf: &mut Self::Buffer) -> &[u8]

Source§

impl PrimitiveEncode for i32

Source§

type Buffer = [u8; 11]

Source§

fn init_buffer() -> Self::Buffer

Source§

fn encode(self, buf: &mut Self::Buffer) -> &[u8]

Source§

impl PrimitiveEncode for i64

Source§

type Buffer = [u8; 20]

Source§

fn init_buffer() -> Self::Buffer

Source§

fn encode(self, buf: &mut Self::Buffer) -> &[u8]

Source§

impl PrimitiveEncode for u8

Source§

type Buffer = [u8; 3]

Source§

fn init_buffer() -> Self::Buffer

Source§

fn encode(self, buf: &mut Self::Buffer) -> &[u8]

Source§

impl PrimitiveEncode for u16

Source§

type Buffer = [u8; 5]

Source§

fn init_buffer() -> Self::Buffer

Source§

fn encode(self, buf: &mut Self::Buffer) -> &[u8]

Source§

impl PrimitiveEncode for u32

Source§

type Buffer = [u8; 10]

Source§

fn init_buffer() -> Self::Buffer

Source§

fn encode(self, buf: &mut Self::Buffer) -> &[u8]

Source§

impl PrimitiveEncode for u64

Source§

type Buffer = [u8; 20]

Source§

fn init_buffer() -> Self::Buffer

Source§

fn encode(self, buf: &mut Self::Buffer) -> &[u8]

Source§

impl PrimitiveEncode for f16

Source§

type Buffer = <f32 as PrimitiveEncode>::Buffer

Source§

fn init_buffer() -> Self::Buffer

Source§

fn encode(self, buf: &mut Self::Buffer) -> &[u8]

Implementors§