trait JsonEncoder[A] extends JsonEncoderPlatformSpecific[A]

Self Type
JsonEncoder[A]
Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. JsonEncoder
  2. JsonEncoderPlatformSpecific
  3. AnyRef
  4. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Abstract Value Members

  1. abstract def unsafeEncode(a: A, indent: Option[Int], out: Write): Unit

Concrete Value Members

  1. final def contramap[B](f: (B) => A): JsonEncoder[B]

    Returns a new encoder, with a new input type, which can be transformed to the old input type by the specified user-defined function.

  2. final def either[B](that: => JsonEncoder[B]): JsonEncoder[Either[A, B]]

    Returns a new encoder that can accepts an Either[A, B] to either, and uses either this encoder or the specified encoder to encode the two different types of values.

  3. final def eitherWith[B, C](that: => JsonEncoder[B])(f: (C) => Either[A, B]): JsonEncoder[C]

    Returns a new encoder with a new input type, which can be transformed to either the input type of this encoder, or the input type of the specified encoder, using the user-defined transformation function.

  4. final def encodeJson(a: A, indent: Option[Int] = None): CharSequence

    Encodes the specified value into a JSON string, with the specified indentation level.

  5. final val encodeJsonArrayPipeline: ZPipeline[Any, Throwable, A, Char]
    Definition Classes
    JsonEncoderPlatformSpecific
  6. final val encodeJsonLinesPipeline: ZPipeline[Any, Throwable, A, Char]
    Definition Classes
    JsonEncoderPlatformSpecific
  7. final def encodeJsonStream(a: A): ZStream[Any, Throwable, Char]

    Encodes the specified value into a character stream.

    Encodes the specified value into a character stream.

    Definition Classes
    JsonEncoderPlatformSpecific
  8. def isNothing(a: A): Boolean

    This default may be overriden when this value may be missing within a JSON object and still be encoded.

    This default may be overriden when this value may be missing within a JSON object and still be encoded.

    Annotations
    @nowarn()
  9. final def narrow[B <: A]: JsonEncoder[B]

    Returns this encoder but narrowed to the its given sub-type

  10. final def orElseEither[B](that: => JsonEncoder[B]): JsonEncoder[Either[A, B]]

    Returns a new encoder that can accepts an Either[A, B] to either, and uses either this encoder or the specified encoder to encode the two different types of values.

    Returns a new encoder that can accepts an Either[A, B] to either, and uses either this encoder or the specified encoder to encode the two different types of values. The difference with the classic either encoder is that the resulting JSON has no field Left or Right. What should be: {"Right": "John Doe"} is encoded as "John Doe"

  11. def toJsonAST(a: A): Either[String, Json]

    Converts a value to a Json AST

    Converts a value to a Json AST

    The default implementation encodes the value to a Json byte stream and uses decode to parse that back to an AST. Override to provide a more performant implementation.

  12. final def zip[B](that: => JsonEncoder[B]): JsonEncoder[(A, B)]

    Returns a new encoder that is capable of encoding a tuple containing the values of this encoder and the specified encoder.

  13. final def zipWith[B, C](that: => JsonEncoder[B])(f: (C) => (A, B)): JsonEncoder[C]

    Returns a new encoder that is capable of encoding a user-defined value, which is create from a tuple of the values of this encoder and the specified encoder, from the specified user- defined function.