Borsh class

Borsh serializer.

Properties

boolean BorshBoolCodec
Creates a bool codec.
no setter
dateTime BorshDateTimeCodec
Creates a date time codec.
no setter
f32 BorshFloat32Codec
Creates an f32 codec.
no setter
f64 BorshFloat64Codec
Creates an f64 codec.
no setter
hashCode int
The hash code for this object.
no setterinherited
i128 BorshInt128Codec
Creates an i128 codec.
no setter
i16 BorshInt16Codec
Creates an i16 codec.
no setter
i32 BorshInt32Codec
Creates an i32 codec.
no setter
i64 BorshInt64Codec
Creates an i64 codec.
no setter
i8 BorshInt8Codec
Creates an i8 codec.
no setter
pubkey BorshStringSizedCodec
Creates a base-58 public key codec.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
u128 BorshUint128Codec
Creates a u128 codec.
no setter
u16 BorshUint16Codec
Creates a u16 codec.
no setter
u32 BorshUint32Codec
Creates a u32 codec.
no setter
u64 BorshUint64Codec
Creates a u64 codec.
no setter
u8 BorshUint8Codec
Creates a u8 codec.
no setter

Methods

array<T>(BorshCodec<T> subtype, int length) BorshArrayCodec<T>
Creates an array codec.
arraySized<T>(BorshCodecFixedSized<T> subtype, int length) BorshArraySizedCodec<T>
Creates an array codec.
buffer(int length) BorshBufferCodec
Creates an buffer codec.
call(BorshSchema schema) BorshStructCodec
Creates a struct codec.
decode(BorshSchema schema, Iterable<int> input) Map<String, dynamic>
Decodes input using schema.
deserialize<T extends BorshObjectMixin>(BorshSchema schema, Iterable<int> input, T decoder(Map<String, dynamic>)) → T
Decodes input using schema and applies decoder to the result.
encode(BorshSchema schema, Map<String, dynamic> input) Iterable<int>
Encodes input using schema.
enumeration<T extends Enum>(List<T> values, [int? byteLength]) BorshEnumCodec<T>
Creates an enum codec.
list<T>(BorshCodec<T> subtype, int length) BorshListCodec<T>
Creates an array codec.
map<K, V>(BorshCodec<K> keyCodec, BorshCodec<V> valueCodec) BorshMapCodec<K, V>
Creates an map codec.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
pack(BorshSchema schema, BufferWriter buffer, Map<String, dynamic> input) → void
Encodes input using schema and writes the result to buffer.
rustEnumeration<T>(List<BorshCodec<T>?> variants) BorshRustEnumCodec<T>
Creates an enum codec for Rust style enums (tuple or struct constructors).
rustEnumerationSized<T>(List<BorshCodecFixedSized<T>?> variants) BorshRustEnumSizedCodec<T>
Creates an enum codec for Rust style enums (tuple or struct constructors) for fixed size data types.
rustString({int lengthPadding = ByteLength.u32, BufferEncoding? encoding}) BorshStringCodec
Creates a string codec for Rust string types.
serialize<T extends BorshObjectMixin>(T input) Iterable<int>
Encodes input using BorshObjectMixin.borshSchema.
string({int? lengthPadding, BufferEncoding? encoding}) BorshStringCodec
Creates a string codec.
stringSized(int length, {BufferEncoding? encoding}) BorshStringSizedCodec
Creates a utf-8 string codec for a fixed length strings
struct(BorshSchema schema) BorshStructCodec
Creates a struct codec.
structSized(BorshSchemaSized schema) BorshStructSizedCodec
Creates a struct codec for fixed size data types.
toString() String
A string representation of this object.
inherited
tuple(List<BorshCodec> fields) BorshTupleCodec
Creates an tuple codec.
tupleSized(List<BorshCodecFixedSized> fields) BorshTupleSizedCodec
Creates an tuple codec for fixed size data types.
unpack(BorshSchema schema, BufferReader buffer) Map<String, dynamic>
Decodes buffer using schema.
vec<T>(BorshCodec<T> codec) BorshVecCodec<T>
Creates an vec codec.
vecSized<T>(BorshCodecFixedSized<T> subtype, int capacity) BorshVecSizedCodec<T>
Creates an vec codec.

Operators

operator ==(Object other) bool
The equality operator.
inherited