OrderedCodec

org.sigilaris.core.codec.OrderedCodec
See theOrderedCodec companion trait
object OrderedCodec

Attributes

Companion
trait
Source
OrderedCodec.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Value members

Concrete methods

def apply[A](using oc: OrderedCodec[A]): OrderedCodec[A]

Summons an OrderedCodec instance for type A.

Summons an OrderedCodec instance for type A.

Attributes

Source
OrderedCodec.scala
def fromCodecAndOrdering[A](codec: ByteCodec[A], ord: Ordering[A]): OrderedCodec[A]

Creates an OrderedCodec from existing ByteCodec and Ordering instances.

Creates an OrderedCodec from existing ByteCodec and Ordering instances.

This is the primary way to create OrderedCodec instances: reuse existing ByteCodec implementations and provide the Ordering.

Value parameters

codec

the ByteCodec instance

ord

the Ordering instance

Attributes

Returns

OrderedCodec that delegates to the given instances

Source
OrderedCodec.scala

Givens

Givens

given orderedByteVector: OrderedCodec[ByteVector]

OrderedCodec for ByteVector using lexicographic (unsigned byte) ordering.

OrderedCodec for ByteVector using lexicographic (unsigned byte) ordering.

The identity codec: encoding returns the ByteVector as-is, and decoding consumes all bytes.

Attributes

Source
OrderedCodec.scala