smithy4s.codecs

package smithy4s.codecs

Members list

Type members

Classlikes

object PayloadCodec

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
case class PayloadError(path: PayloadPath, expected: String, message: String) extends Throwable, NoStackTrace

Attributes

Companion
object
Supertypes
trait Product
trait Equals
trait NoStackTrace
class Throwable
trait Serializable
class Object
trait Matchable
class Any
Show all
object PayloadError

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
case class PayloadPath(segments: List[Segment])

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object PayloadPath

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
object PayloadReader

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
object PayloadWriter

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
trait Reader[F[_], -Message, A]

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Self type
Reader[F, Message, A]
object Reader

Attributes

Companion
trait
Supertypes
class Object
trait Matchable
class Any
Self type
Reader.type
final case class ReaderWriter[F[_], G[_], A](reader: F[A], writer: G[A])

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object ReaderWriter

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
trait Writer[-In, +Out, -A]

An abstraction that codifies the notion of writing a piece of data into an output, provided some contextual information.

An abstraction that codifies the notion of writing a piece of data into an output, provided some contextual information.

This has two input channels:

  • one for contextual information (In)
  • one for the actual data (A)

This is particularly useful for http requests/responses, where different subsets of data have a different impact on different locations of the http message : some fields may impact headers, some fields may impact the http body, other things that are driven from static information (smithy traits) may lead to a transformation of the message. In this situation, the Input and Output channels are of the same type.

Having the ability to decompose the notion of encoding a piece of data into different writers that can be composed together is powerful and helps centralising some complexity in third-party agnostic code.

Type parameters

A:

the type of data that is being written into the output channel

In

: some input channel used as context to write data. When set to Any, the implication is that the data produces some output on its own

Out:

the output channel in which the data is written.

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Self type
Writer[In, Out, A]
object Writer

Attributes

Companion
trait
Supertypes
class Object
trait Matchable
class Any
Self type
Writer.type

Types

type Encoder[Out, A] = Writer[Any, Out, A]
type PayloadReader[A] = Reader[[_] =>> Either[PayloadError, _$1], Blob, A]
type PayloadWriter[A] = Writer[Any, Blob, A]