encodeTo method

  1. @override
void encodeTo(
  1. Option<E> value,
  2. Output output
)
override

Convert self to a slice and append it to the destination.

Implementation

@override
void encodeTo(Option<E> value, Output output) {
  if (value.isNone) {
    output.pushByte(0);
  } else {
    output.pushByte(1);
    subtypeCodec.encodeTo(value.value as E, output);
  }
}