encode

open fun <T> encode(typeTag: TypeTag<T>, value: T): CompletableFuture<Slice>

Resolve the serde, serialize the value, then encode it.