Encoder

object Encoder extends EncoderFunctions

Companion for Encoder.

Companion
class
class Object
trait Matchable
class Any

Value members

Concrete methods

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

Creates an encoder from the specified function.

Creates an encoder from the specified function.

Inherited methods

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.

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

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

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

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

Inherited from
EncoderFunctions
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.

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

Inherited from
EncoderFunctions

Extensions

Extensions

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