Module gtv

Module gtv 

Source
Expand description

GTV (Generic Type Value) encoding and decoding module

This module provides functionality for encoding and decoding GTV format, which is a flexible data serialization format supporting various data types including null, boolean, integer, string, arrays, dictionaries, and big integers. It uses ASN.1 encoding rules for data representation.

§Features

  • Basic types: null, boolean, integer, string, byte array
  • Complex types: arrays, dictionaries
  • Special types: big integers, decimals
  • Transaction encoding/decoding
  • ASN.1-based encoding rules

§Examples

// Encoding a simple value
let value = Params::Text("hello".to_string());
let encoded = encode_value(&value);
 
// Decoding a value
let decoded = decode(&encoded).unwrap();

Enums§

Choice
GTVType

Traits§

GTVParams

Functions§

decode
Decodes a byte slice into a GTV value
decode_tx
Decodes a transaction from a byte slice
encode
Encodes a query and its arguments into GTV format
encode_tx
Encodes a transaction into a byte vector using GTV format
encode_value
Encodes a single GTV value into a byte vector
encode_value_hex_encode
Encodes a GTV value and returns it as a hexadecimal string
to_draw_gtx
Converts a transaction into a GTV representation for visualization
write_explicit_element