Encoder

object Encoder extends EncoderFunctions

Companion for Encoder.

Companion
class
class Object
trait Matchable
class Any

Document{}

def apply[A](f: A => Attempt[BitVector]): Encoder[A]

Creates an encoder from the specified function.

final def encodeBoth[A, B](encA: Encoder[A], encB: Encoder[B])(a: A, b: B): Attempt[BitVector]

Encodes the specified values, one after the other, to a bit vector using the specified encoders.

Inherited from
EncoderFunctions
final def encode[A](a: A)(using encA: Encoder[A]): Attempt[BitVector]

Encodes the specified value using the given Encoder[A].

Inherited from
EncoderFunctions
final def choiceEncoder[A](encoders: Encoder[A]*): Encoder[A]

Creates an encoder that encodes with each of the specified encoders, returning the first successful result.

Inherited from
EncoderFunctions

Value members

Methods

inline def apply[A](using e: Encoder[A]): Encoder[A]

Givens

Givens

Extensions

Extensions

extension (encoder: Encoder[A])
def as[A](using iso: Iso[A, B]): Encoder[B]