YamlCodec

zio.blocks.schema.yaml.YamlCodec
See theYamlCodec companion object
abstract class YamlCodec[A] extends BinaryCodec[A]

Abstract base class for YAML binary codecs that serialize/deserialize values of type A to and from YAML representations.

Type parameters

A

the type this codec handles

Attributes

Companion
object
Source
YamlCodec.scala
Graph
Supertypes
class BinaryCodec[A]
class Object
trait Matchable
class Any

Members list

Value members

Abstract methods

def decodeValue(in: Yaml): A

Attributes

Source
YamlCodec.scala
def encodeValue(x: A): Yaml

Attributes

Source
YamlCodec.scala

Concrete methods

override def decode(input: ByteBuffer): Either[SchemaError, A]

Decodes the specified input into a value of the target type.

Decodes the specified input into a value of the target type.

Value parameters

input

The input data that needs to be decoded.

Attributes

Returns

Either a SchemaError indicating the decoding failure, or a decoded value.

Definition Classes
Source
YamlCodec.scala
def decode(input: Array[Byte]): Either[SchemaError, A]

Attributes

Source
YamlCodec.scala
def decode(input: String): Either[SchemaError, A]

Attributes

Source
YamlCodec.scala
def decodeKey(s: String): A

Attempts to decode a value of type A from the string representation.

Attempts to decode a value of type A from the string representation.

Attributes

Source
YamlCodec.scala
override def encode(value: A, output: ByteBuffer): Unit

Encodes the given value into the specified output representation.

Encodes the given value into the specified output representation.

Value parameters

output

The target output into which the value will be encoded.

value

The value to be encoded.

Attributes

Returns

This method does not return a value.

Definition Classes
Source
YamlCodec.scala
def encode(value: A): Array[Byte]

Attributes

Source
YamlCodec.scala
def encodeKey(x: A): String

Converts a value to its string representation for use as a YAML key.

Converts a value to its string representation for use as a YAML key.

Attributes

Source
YamlCodec.scala
def encodeToString(value: A): String

Attributes

Source
YamlCodec.scala
def error(span: Node, error: Throwable): Nothing

Throws a YamlCodecError wrapping the given error and adding a span.

Throws a YamlCodecError wrapping the given error and adding a span.

Value parameters

error

the error to wrap

span

the span to add to the error

Attributes

Throws
Source
YamlCodec.scala
def error(span1: Node, span2: Node, error: Throwable): Nothing

Throws a YamlCodecError wrapping the given error and adding two spans.

Throws a YamlCodecError wrapping the given error and adding two spans.

Value parameters

error

the error to wrap

span1

the first span to add to the error

span2

the second span to add to the error

Attributes

Throws
Source
YamlCodec.scala
def error(message: String): Nothing

Throws a YamlCodecError with the given error message.

Throws a YamlCodecError with the given error message.

Value parameters

message

the error message

Attributes

Throws
Source
YamlCodec.scala