avro · API

avro.encoder

The Avro binary encoder — the inverse of avro.decoder.

Structs

Encoder

struct Encoder

Appends Avro binary data to an owned List[UInt8].

Implements Copyable, Defaultable, Movable, Sized

Fields
out: List[UInt8]

__init__

def __init__(out self)
def __init__(out self, capacity: Int)

__len__

def __len__(self) -> Int

take

def take(deinit self) -> List[UInt8]

bytes

def bytes(self) -> List[UInt8]

reset

def reset(mut self)

write_boolean

def write_boolean(mut self, v: Bool)

write_long

def write_long(mut self, v: Int64)

Zigzag varint.

write_int

def write_int(mut self, v: Int32)

write_float

def write_float(mut self, v: Float32)

write_double

def write_double(mut self, v: Float64)

write_fixed

def write_fixed(mut self, v: Span[UInt8])

write_bytes

def write_bytes(mut self, v: Span[UInt8])

write_string

def write_string(mut self, v: StringSpan)

write_value

def write_value(mut self, schema: Schema, value: Value)

write_value_at

def write_value_at(mut self, schema: Schema, i: Int, value: Value)

Functions

encode_value

def encode_value(schema: Schema, value: Value) -> List[UInt8]

One-shot: encode value against schema into a fresh buffer.