package borer
- Alphabetic
- By Inheritance
- borer
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Type Members
-
trait
AdtDecoder[T] extends Decoder[T]
An AdtDecoder is a Decoder whose
read
method expects to read an envelope (holding the type id) around the actual value encoding.An AdtDecoder is a Decoder whose
read
method expects to read an envelope (holding the type id) around the actual value encoding.In order to be able to collapse several envelope levels into a single one, when several AdtDecoder instances call each other, this type also provides
read
overloads which don't read the type id envelope themselves but can receive the type id from the outside. -
trait
AdtEncoder[T] extends Encoder[T]
An AdtEncoder is an Encoder which encodes its values with an envelope holding the value's type id.
An AdtEncoder is an Encoder which encodes its values with an envelope holding the value's type id.
It doesn't change or add to the outside interface of Encoder but merely serves as a marker signaling that it takes on the responsibility of encoding the type id in addition to the value itself. This allows outside encoders calling an AdtEncoder to delegate this responsibility rather than performing the task themselves.
- sealed abstract class AdtEncodingStrategy extends AnyRef
-
trait
ByteAccess[Bytes] extends AnyRef
Type class for providing basic access to a
Bytes
abstraction, as well as construction of a respective Output. - final class ByteStringArrayCodecs extends AnyRef
-
final
case class
Codec[A](encoder: Encoder[A], decoder: Decoder[A]) extends Product with Serializable
A simple encapsulation of an Encoder and Decoder for the same type, as one entity.
A simple encapsulation of an Encoder and Decoder for the same type, as one entity.
Sometimes it's easier to supply just a single implicit for a type, rather than two. As an alternative to writing a separate Encoder and Decoder for type A you can also write a Codec for A. (Encoder and Decoder can be implicitly "unpacked" from a codec.)
However, in order to not hinder composability Codecs should only ever be _supplied_, never consumed. So, if you write an encoder, decoder or codec for a generic type, which itself requires implicitly available encoders and/or decoders for certain type parameters (like
Encoder.forOption
, for example) then you should never require implicitly available Codecs, but rather Encoders and Decoders separately. -
trait
Decoder[T] extends AnyRef
Type class responsible for reading an instance of type T from a Reader.
- abstract class DecoderFromApply extends AnyRef
- final case class Default[+T](defaultValue: T) extends Product with Serializable
-
trait
Encoder[T] extends AnyRef
Type class responsible for writing an instance of type T to a Writer.
-
final
case class
Float16(value: Float) extends Product with Serializable
Wrapper for Float value that gets encoded to and decoded from 16-bit Half-Precision Floats (two-byte IEEE 754).
-
trait
Input[Bytes] extends AnyRef
Mutable abstraction wrapping some source of bytes to serve as parser input.
-
final
class
InputReader[Config <: Config] extends AnyRef
Stateful, mutable abstraction for reading a stream of CBOR or JSON data from the given
input
. - sealed abstract class LowPrioDecoders extends TupleDecoders
- sealed abstract class LowPrioEncoders extends TupleEncoders
- sealed abstract class LowPrioNullable extends AnyRef
- final class Nullable[+T] extends AnyVal
-
trait
Output extends AnyRef
Abstraction over serialization output.
Abstraction over serialization output.
The implementation can be either mutable or immutable.
- type Reader = InputReader[_ <: Config]
-
abstract
class
Receiver extends AnyRef
The common interface of all types that consume CBOR data.
The common interface of all types that consume CBOR data. (On the reading as well as the writing side)
-
final
case class
SimpleValue(value: Int) extends Product with Serializable
Abstraction for a "simple value" in CBOR-speak.
Abstraction for a "simple value" in CBOR-speak.
- value
the value's code
-
sealed abstract
class
Tag extends AnyRef
Abstraction for a "tag" in CBOR-speak.
- final case class TaggedValue[T](tag: Tag, value: T) extends Product with Serializable
- sealed abstract class Target extends AnyRef
- abstract class TupleDecoders extends DecoderFromApply
- abstract class TupleEncoders extends AnyRef
-
final
class
Writer extends AnyRef
Stateful, mutable abstraction for writing a stream of CBOR or JSON data to the given Output.
Value Members
- object AdtEncodingStrategy
-
object
Borer
Main entry point into the CBOR API.
- object ByteAccess
- object ByteStringArrayCodecs
- object Cbor extends Target with Product with Serializable
- object Codec extends Serializable
-
object
DataItem
A simple mapping of CBOR data item types to bits for efficient masking.
- object Decoder extends LowPrioDecoders
- object DecodingSetup
- object Default extends Serializable
-
object
Dom
Simple Document Object Model (DOM) for CBOR.
- object Encoder extends LowPrioEncoders
- object EncodingSetup
-
object
Float16 extends Serializable
Logic for converting half-precision (16-bit) floats to and from bytes.
Logic for converting half-precision (16-bit) floats to and from bytes.
Source: https://stackoverflow.com/questions/6162651 (The author says it's public domain.)
The documented author's "extensions" have been removed for clean round-tripping to and from Float.
- object Input extends FromByteArrayInput with FromByteBufferInput with FromInputStreamInput with FromFileInput with FromIteratorInput
- object Json extends Target with Product with Serializable
-
object
Logging
Facilities for on-the-side logging of either encoding or decoding progress, which can be useful for debugging problems with the input or custom codec logic.
Facilities for on-the-side logging of either encoding or decoding progress, which can be useful for debugging problems with the input or custom codec logic.
Logging can be done either before or after the input validation step, depending on your needs. If unsure, go for after-validation logging, at least initially. (This is also the default.) For example, to log decoding progress to the console you can say:
Cbor.decode(inputBytes).withPrintLogging().to[MyType]
-
object
NullOptions
In order to enable an alternative Option codec, which encodes
None
tonull
andSome
to an unwrapped value you can import the members of this object withIn order to enable an alternative Option codec, which encodes
None
tonull
andSome
to an unwrapped value you can import the members of this object withimport io.bullet.borer.NullOptions._
- object Nullable extends LowPrioNullable
- object Output extends ToByteArrayOutput with ToByteBufferOutput with ToFileOutput with ToOutputStreamOutput
- object Reader
- object Receiver
- object Scalac
- object SimpleValue extends Serializable
- object Tag
- object TaggedValue extends Serializable
-
object
Undefined extends Product with Serializable
Abstraction for the "undefined" value in CBOR-speak.
- object Utf8
- object Writer