thrifty/types

Types

How boolean elements (bytes inside list/set/map representing booleans) are interpreted and validated by the reader.

pub type BoolElementPolicy {
  AcceptBoth
  AcceptCanonicalOnly
}

Constructors

  • AcceptBoth
  • AcceptCanonicalOnly
pub type DecodeError {
  UnexpectedEndOfInput
  InvalidVarint
  InvalidFieldType(expected: Int, got: Int)
  UnsupportedType(Int)
  InvalidWireFormat(String)
}

Constructors

  • UnexpectedEndOfInput
  • InvalidVarint
  • InvalidFieldType(expected: Int, got: Int)
  • UnsupportedType(Int)
  • InvalidWireFormat(String)
pub type FieldHeader {
  FieldHeader(field_id: Int, field_type: FieldType)
}

Constructors

  • FieldHeader(field_id: Int, field_type: FieldType)
pub type FieldType {
  BoolTrue
  BoolFalse
  Byte
  I16
  I32
  I64
  Double
  Binary
  List
  Set
  Map
  Struct
  Stop
}

Constructors

  • BoolTrue
  • BoolFalse
  • Byte
  • I16
  • I32
  • I64
  • Double
  • Binary
  • List
  • Set
  • Map
  • Struct
  • Stop
pub type Reader {
  Reader(data: BitArray, position: Int, options: ReaderOptions)
}

Constructors

pub type ReaderOptions {
  ReaderOptions(
    max_depth: Int,
    max_container_items: Int,
    max_string_bytes: Int,
    bool_element_policy: BoolElementPolicy,
  )
}

Constructors

  • ReaderOptions(
      max_depth: Int,
      max_container_items: Int,
      max_string_bytes: Int,
      bool_element_policy: BoolElementPolicy,
    )

Values

pub fn decode_error_to_string(err: DecodeError) -> String

Convert a DecodeError into a human readable string for logging or metadata files.

pub const default_reader_options: ReaderOptions
Search Document