Encoder

scodec.Encoder$
See theEncoder companion trait
object Encoder extends EncoderFunctions

Companion for Encoder.

Attributes

Companion:
trait
Source:
Encoder.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
Encoder.type

Members list

Concise view

Type members

Classlikes

Attributes

Source:
Encoder.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Value members

Concrete methods

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

Attributes

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

Creates an encoder from the specified function.

Creates an encoder from the specified function.

Attributes

Source:
Encoder.scala

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.

Attributes

Inherited from:
EncoderFunctions
Source:
Encoder.scala
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].

Attributes

Inherited from:
EncoderFunctions
Source:
Encoder.scala
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.

Attributes

Inherited from:
EncoderFunctions
Source:
Encoder.scala

Givens

Extensions

Extensions

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

Attributes

Source:
Encoder.scala