zio.schema

package zio.schema

Members list

Type members

Classlikes

Attributes

Source
AccessorBuilder.scala
Supertypes
class Object
trait Matchable
class Any
object Append extends AppendLowPriority

Attributes

Companion
trait
Source
CaseSet.scala
Supertypes
class Object
trait Matchable
class Any
Self type
Append.type
sealed trait Append[EnumType, -Left, -Right]

Attributes

Companion
object
Source
CaseSet.scala
Supertypes
class Object
trait Matchable
class Any

Attributes

Source
CaseSet.scala
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object Append

Attributes

Source
CaseSet.scala
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object Append
sealed trait CaseSet

Attributes

Companion
object
Source
CaseSet.scala
Supertypes
class Object
trait Matchable
class Any
Known subtypes
trait A :+: T
class Cons[A, T, Z]
class Empty[Z]
Self type
object CaseSet

Attributes

Companion
trait
Source
CaseSet.scala
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
CaseSet.type
object Cons0

Attributes

Source
CaseSet.scala
Supertypes
class Object
trait Matchable
class Any
Self type
Cons0.type
object Derive

Attributes

Source
Derive.scala
Supertypes
class Object
trait Matchable
class Any
Self type
Derive.type
object DeriveSchema

Attributes

Source
DeriveSchema.scala
Supertypes
class Object
trait Matchable
class Any
Self type
object Deriver

Attributes

Companion
trait
Source
Deriver.scala
Supertypes
class Object
trait Matchable
class Any
Self type
Deriver.type
trait Deriver[F[_]] extends VersionSpecificDeriver[F]

Deriver builds type class instances based on a Schema.

Deriver builds type class instances based on a Schema.

The minimum set of methods to implement are:

  • deriveRecord
  • deriveEnum
  • derivePrimitive
  • deriveOption
  • deriveSequence
  • deriveMap
  • deriveTransformedRecord (for records with more than 22 fields)

In addition to this more methods can be overridden to handle all the supported Schema types of zio-schema:

  • deriveEither (calls deriveEnum by default)
  • deriveSet (calls deriveSequence by default)
  • deriveTupleN (calls deriveRecord by default)

The cached method converts this deriver to one that uses a cache of instances shared between macro invocations.

Each derive methods get an optional summoned implicit value of the derived type class. It is the deriver's decision whether to use the available instance (as a user defined customization for a given type) or not.

If the decision is to always accept a summoned value if there is any, use the Deriver.AutoAcceptSummoned trait which implements this automatically and only calls the trait's methods in case there is no available implicit for the actual type.

Attributes

Companion
object
Source
Deriver.scala
Supertypes
class Object
trait Matchable
class Any
Self type
Deriver[F]
object Differ

Attributes

Companion
trait
Source
Differ.scala
Supertypes
class Object
trait Matchable
class Any
Self type
Differ.type
trait Differ[A]

Attributes

Companion
object
Source
Differ.scala
Supertypes
class Object
trait Matchable
class Any
Self type
Differ[A]
sealed trait DynamicValue

Attributes

Companion
object
Source
DynamicValue.scala
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class BothValue
class Dictionary
class DynamicAst
class Enumeration
class Error
class LeftValue
object NoneValue
class Primitive[A]
class Record
class RightValue
class Sequence
class SetValue
class Singleton[A]
class SomeValue
class Tuple
Show all
Self type
object DynamicValue

Attributes

Companion
trait
Source
DynamicValue.scala
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
trait Factory[A]

Useful to create factory methods.

Useful to create factory methods.

import Factory._ def createSomeTrait[A: Factory](deriver: Deriver[SomeTrait])(implicit schema: Schema[A]): SomeTrait[A] = implicitly[Factory[A]].deriveSomeTrait

Attributes

Companion
object
Source
Factory.scala
Supertypes
class Object
trait Matchable
class Any
object Factory

Attributes

Companion
trait
Source
Factory.scala
Supertypes
class Object
trait Matchable
class Any
Self type
Factory.type
sealed trait Fallback[+A, +B]

Fallback represents an enriched Either type that can contain both a left and a right value. The left value represents the default value, that fallbacks to the right value when it is not found.

Fallback represents an enriched Either type that can contain both a left and a right value. The left value represents the default value, that fallbacks to the right value when it is not found.

Attributes

Companion
object
Source
Fallback.scala
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class Both[A, B]
class Left[A, B]
class Right[A, B]
Self type
Fallback[A, B]
object Fallback

Attributes

Companion
trait
Source
Fallback.scala
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
Fallback.type
object FieldSet

Attributes

Companion
trait
Source
FieldSet.scala
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
FieldSet.type
sealed trait FieldSet

Attributes

Companion
object
Source
FieldSet.scala
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class A :*: T
object Empty
trait MutableSchemaBasedValueBuilder[Target, Context]

Base trait for mutable builders producing a value based on a schema, such as codec decoders.

Base trait for mutable builders producing a value based on a schema, such as codec decoders.

The implementation is stack safe and consists of a series of invocations of the protected methods the trait defines. Maintaining the state of the builder, such as stream position etc. is the responsibility of the implementation class via mutable state.

The Target type parameter is the base type for the generated values - this in many cases can be Any but potentially could be used to track errors in value level as well - although failure in the context handler manipulation methods cannot be expressed this way.

The Context type parameter is a use-case dependent type that is managed in a stack during the execution of the builder. The implementation can generate new context values for the value's subtrees and it can be used to track local state required for gathering all information for the value to be created. The current context value is also propagated to any exception thrown so it can be used to provide detailed location information for decoder errors.

Attributes

Companion
object
Source
MutableSchemaBasedValueBuilder.scala
Supertypes
class Object
trait Matchable
class Any
Known subtypes

Attributes

Companion
trait
Source
MutableSchemaBasedValueBuilder.scala
Supertypes
class Object
trait Matchable
class Any
Self type
trait MutableSchemaBasedValueProcessor[Target, Context]

Base trait for mutable value processors, processing a value with a known schema. An example is protocol encoders.

Base trait for mutable value processors, processing a value with a known schema. An example is protocol encoders.

The implementation is stack safe and consists of invocations of a series of processXYZ methods, as well as built-in support for a context value which is handled in a stacked way.

Maintaining any global state (per process) such as stream writers etc. is the responsibility of the implementation class.

The Target type parameter is the base type for the process function's output value. In case the process is built entirely using side effects (such as calls to a mutable writer interface) this type can be Unit.

The Context type parameter is the use-case specific context type which is passed for each process invocation, and can be manipulated before each process call achieving a local state.

Attributes

Source
MutableSchemaBasedValueProcessor.scala
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object NameFormat

Attributes

Companion
trait
Source
NameFormat.scala
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
NameFormat.type
sealed trait NameFormat extends String => String

Attributes

Companion
object
Source
NameFormat.scala
Supertypes
trait String => String
class Object
trait Matchable
class Any
Known subtypes
object CamelCase
class Custom
object Identity
object KebabCase
object PascalCase
object SnakeCase
Show all
object Patch

Attributes

Companion
trait
Source
Patch.scala
Supertypes
class Object
trait Matchable
class Any
Self type
Patch.type
sealed trait Patch[A]

Attributes

Companion
object
Source
Patch.scala
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class BigDecimal
class BigInt
class Bool
class Currency
class EitherDiff[A, B]
class Fallback[A, B]
class Identical[A]
class LCS[A]
class NotComparable[A]
class Number[A]
class Record[R]
class Temporal[A]
class Total[A]
class Transform[A, B]
class Tuple[A, B]
Show all
Self type
Patch[A]
class ReflectionUtils[Q <: Quotes & Singleton](val q: Q)

Attributes

Source
ReflectionUtils.scala
Supertypes
class Object
trait Matchable
class Any
sealed trait Schema[A]

A Schema[A] describes the structure of some data type A, in terms of case classes, enumerations (sealed traits), collections, and various primitive types (including not only Scala's own primitive types, but enhanced with java.time and big integers / decimals).

A Schema[A] describes the structure of some data type A, in terms of case classes, enumerations (sealed traits), collections, and various primitive types (including not only Scala's own primitive types, but enhanced with java.time and big integers / decimals).

Schemas models the structure of data types as first class values, so they can be introspected, transformed, and combined using ordinary Scala code, without macros, metaprogramming, or codegen.

There are implicit schemas provided for all standard Scala types, and you can automatically derive schemas for your own data types by using DeriveSchema.gen[A]. Whether you write them by hand by using constructors and operators,

final case class Person(name: String, age: Int)
object Person {
 implicit val personSchema: Schema[Person] = DeriveSchema.gen[Person]
}

Attributes

Companion
object
Source
Schema.scala
Supertypes
class Object
trait Matchable
class Any
Known subtypes
trait Collection[Col, Elem]
class Map[K, V]
class NonEmptyMap[K, V]
class NonEmptySequence[Col, Elm, I]
class Sequence[Col, Elem, I]
class Set[A]
class Dynamic
class Either[A, B]
trait Enum[Z]
class Enum1[A, Z]
class Enum10[A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, Z]
class Enum11[A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, Z]
class Enum12[A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, Z]
class Enum13[A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, Z]
class Enum14[A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, Z]
class Enum15[A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, Z]
class Enum16[A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, Z]
class Enum17[A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, Z]
class Enum18[A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, Z]
class Enum19[A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, Z]
class Enum2[A1, A2, Z]
class Enum20[A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, Z]
class Enum21[A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, Z]
class Enum22[A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22, Z]
class Enum3[A1, A2, A3, Z]
class Enum4[A1, A2, A3, A4, Z]
class Enum5[A1, A2, A3, A4, A5, Z]
class Enum6[A1, A2, A3, A4, A5, A6, Z]
class Enum7[A1, A2, A3, A4, A5, A6, A7, Z]
class Enum8[A1, A2, A3, A4, A5, A6, A7, A8, Z]
class Enum9[A1, A2, A3, A4, A5, A6, A7, A8, A9, Z]
class EnumN[Z, C]
class Fail[A]
class Fallback[A, B]
class Lazy[A]
class Optional[A]
class Primitive[A]
trait Record[R]
trait CaseClass0[Z]
trait CaseClass1[A, Z]
trait CaseClass10[A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, Z]
trait CaseClass11[A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, Z]
trait CaseClass12[A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, Z]
trait CaseClass13[A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, Z]
trait CaseClass14[A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, Z]
trait CaseClass15[A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, Z]
trait CaseClass16[A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, Z]
trait CaseClass17[A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, Z]
trait CaseClass18[A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, Z]
trait CaseClass19[A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, Z]
trait CaseClass2[A1, A2, Z]
trait CaseClass20[A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, Z]
trait CaseClass21[A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, Z]
trait CaseClass22[A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22, Z]
trait CaseClass3[A1, A2, A3, Z]
trait CaseClass4[A1, A2, A3, A4, Z]
trait CaseClass5[A1, A2, A3, A4, A5, Z]
trait CaseClass6[A1, A2, A3, A4, A5, A6, Z]
trait CaseClass7[A1, A2, A3, A4, A5, A6, A7, Z]
trait CaseClass8[A1, A2, A3, A4, A5, A6, A7, A8, Z]
trait CaseClass9[A1, A2, A3, A4, A5, A6, A7, A8, A9, Z]
class Transform[A, B, I]
class Tuple2[A, B]
Show all
Self type
Schema[A]

Attributes

Companion
trait
Source
Schema.scala
Supertypes
class Object
trait Matchable
class Any
Show all
Self type
Schema.type

Attributes

Source
SchemaEquality.scala
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object Schema

Attributes

Source
SchemaOrdering.scala
Supertypes
class Object
trait Matchable
class Any
Self type

Attributes

Source
SchemaPlatformSpecific.scala
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object Schema
trait SchemaSyntax

Attributes

Source
syntax.scala
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object syntax

Attributes

Source
SchemaVersionSpecific.scala
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object Schema

A simpler version of SimpleMutableSchemaBasedValueBuilder without using any Context

A simpler version of SimpleMutableSchemaBasedValueBuilder without using any Context

Attributes

Source
MutableSchemaBasedValueBuilder.scala
Supertypes
class Object
trait Matchable
class Any

A simpler version of MutableSchemaBasedValueProcessor without using any Context

A simpler version of MutableSchemaBasedValueProcessor without using any Context

Attributes

Source
MutableSchemaBasedValueProcessor.scala
Supertypes
class Object
trait Matchable
class Any
object StandardType

Attributes

Companion
trait
Source
StandardType.scala
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
sealed trait StandardType[A] extends Ordering[A]

Attributes

Companion
object
Source
StandardType.scala
Supertypes
trait Ordering[A]
trait PartialOrdering[A]
trait Equiv[A]
trait Serializable
trait Comparator[A]
class Object
trait Matchable
class Any
Show all
Known subtypes
object BinaryType
object BoolType
object ByteType
object CharType
object CurrencyType
object DayOfWeekType
object DoubleType
object DurationType
object FloatType
object InstantType
object IntType
object LocalDateType
object LocalTimeType
object LongType
object MonthDayType
object MonthType
object PeriodType
object ShortType
object StringType
object UUIDType
object UnitType
object YearMonthType
object YearType
object ZoneIdType
Show all
Self type
object TypeId

Attributes

Companion
trait
Source
TypeId.scala
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
TypeId.type
sealed trait TypeId

Attributes

Companion
object
Source
TypeId.scala
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class Nominal
object Structural
Self type

Attributes

Source
VersionSpecificDeriver.scala
Supertypes
class Object
trait Matchable
class Any
Known subtypes
trait Deriver[F]
Self type
Deriver[F]
object syntax extends SchemaSyntax

Attributes

Source
syntax.scala
Supertypes
trait SchemaSyntax
class Object
trait Matchable
class Any
Self type
syntax.type

Types

type Singleton = Singleton

Attributes

Source
package.scala

Extensions

Extensions

extension [A <: C, B <: C, C](s: Fallback[A, B])
transparent inline def merge: Schema[C]

Attributes

Source
package.scala
extension (s: Schema.type)
transparent inline def derived[A]: Schema[A]

Attributes

Source
DeriveSchema.scala
extension [A <: C, C](s: Schema[A])
transparent inline def orElse[B <: C](s0: Schema[B]): Schema[C]

Attributes

Source
package.scala