ThriftCodec

zio.blocks.schema.thrift.ThriftCodec
See theThriftCodec companion object
abstract class ThriftCodec[A] extends BinaryCodec[A]

Base class for Thrift binary codecs. Provides encoding and decoding of values using Apache Thrift's TBinaryProtocol.

Type parameters

A

The type being encoded/decoded

Attributes

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

Members list

Value members

Abstract methods

def decodeValue(protocol: TProtocol): A

Decodes a value from the Thrift protocol. May throw on malformed input.

Decodes a value from the Thrift protocol. May throw on malformed input.

Attributes

Source
ThriftCodec.scala
def encodeValue(value: A, protocol: TProtocol): Unit

Encodes a value to the Thrift protocol.

Encodes a value to the Thrift protocol.

Attributes

Source
ThriftCodec.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
ThriftCodec.scala
def decode(input: Array[Byte]): Either[SchemaError, A]

Decodes from a byte array.

Decodes from a byte array.

Attributes

Source
ThriftCodec.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
ThriftCodec.scala
def encode(value: A): Array[Byte]

Encodes to a byte array.

Encodes to a byte array.

Attributes

Source
ThriftCodec.scala
def error(expectation: String): Nothing

Throws decode error with the given message.

Throws decode error with the given message.

Attributes

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

Throws decode error with a path span and underlying error.

Throws decode error with a path span and underlying error.

Attributes

Source
ThriftCodec.scala