package codecs
- Alphabetic
- By Inheritance
- codecs
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Type Members
- trait AsBytes[EncodingFailure, Decoded] extends AnyRef
A typeclass which encodes a value to a byte array
A typeclass which encodes a value to a byte array
Usage:
import cats.implicits._ import co.topl.utils.AsBytes.implicits._ sealed abstract class StringAsBytesFailure implicit val stringAsBytes: AsBytes[StringAsBytesFailure, String] = _.getBytes("UTF-8").validNec "Test".encodeAsBytes[StringAsBytesFailure]
- EncodingFailure
The domain-specific failure conditions from encoding the domain object. If encoding is never expected to fail, you may specify
Infallibleas the type which grants access to a helper operation for direct encoding without validation- Decoded
The domain-specific representation
- trait FromBytes[DecodeFailure, Decoded] extends AnyRef
A typeclass which decodes a value from a byte array
A typeclass which decodes a value from a byte array
Usage:
import cats.implicits._ import co.topl.utils.FromBytes.implicits._ sealed abstract class BytesAsStringFailure implicit val bytesAsString: FromBytes[BytesAsStringFailure, String] = new String(_, "UTF-8").validNec val bytes: Array[Byte] = ??? bytes.decodeTo[BytesAsStringFailure, String]
- DecodeFailure
The domain-specific failure conditions from decoding the domain object. If decoding is never expected to fail, you may specify
Infallibleas the type which grants access to a helper operation for direct decoding without validation- Decoded
The domain-specific representation
- final class Infallible extends AnyRef
This type is used in Codecs that have no failure cases and are only expected to succeed.
This type is used in Codecs that have no failure cases and are only expected to succeed. Because the constructor is private, implementations are unable to instantiate one, thus guaranteeing a successful encode or decode attempt.
Value Members
- object AsBytes
- object CryptoCodec
- object FromBytes
- object Int128Codec
- object SizedBytesCodec
- object StringDataTypesCodec
- object implicits extends Instances with ToOps with Instances with ToOps with CryptoCodecInstances with StringTypesInstances with Instances with Implicits