AsRoot

io.circe.Encoder$.AsRoot
See theAsRoot companion object
trait AsRoot[A] extends Encoder[A]

A subtype of Encoder that statically verifies that the instance encodes either a JSON array or an object.

Attributes

Companion:
object
Source:
Encoder.scala
Graph
Supertypes
trait Encoder[A]
class Object
trait Matchable
class Any
Known subtypes
trait AsRoot[A]
trait AsArray[A]
trait AsObject[A]
trait AsArray[A]
trait AsObject[A]

Members list

Concise view

Value members

Inherited methods

def apply(a: A): Json

Convert a value to JSON.

Convert a value to JSON.

Attributes

Inherited from:
Encoder
Source:
Encoder.scala
final def contramap[B](f: B => A): Encoder[B]

Create a new Encoder by applying a function to a value of type B before encoding as an A.

Create a new Encoder by applying a function to a value of type B before encoding as an A.

Attributes

Inherited from:
Encoder
Source:
Encoder.scala
final def mapJson(f: Json => Json): Encoder[A]

Create a new Encoder by applying a function to the output of this one.

Create a new Encoder by applying a function to the output of this one.

Attributes

Inherited from:
Encoder
Source:
Encoder.scala