BorshOptionCodec<T> class

Option Codec

A codec for optional values.

Inheritance

Constructors

BorshOptionCodec.new(BorshCodec<T> subtype, BorshOptionType? type)
Creates a codec for optional values.
const

Properties

decoder BorshOptionDecoder<T>
Returns the decoder of this, converting from T to S.
no setteroverride
encoder BorshOptionEncoder<T>
Returns the encoder from S to T.
no setteroverride
hashCode int
The hash code for this object.
no setterinherited
inverted Codec<Iterable<int>, T?>
Inverts this.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
subtype BorshCodec<T>
The data type's codec.
finalinherited
type BorshOptionType
The option flag's byte length (default: BorshOptionType.rust).
finalinherited

Methods

decode(Iterable<int> encoded) → T?
Decodes encoded data.
inherited
encode(T? input) Iterable<int>
Encodes input.
inherited
fuse<R>(Codec<Iterable<int>, R> other) Codec<T?, R>
Fuses this with other.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
pack(BufferWriter buffer, T? input) → void
Writes input to buffer.
inherited
size(T? input) int
Returns the serialized byte length of input.
override
toString() String
A string representation of this object.
inherited
unpack(BufferReader buffer) → T?
Reads T from buffer.
inherited

Operators

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