Packages

package codecs

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. codecs
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Type Members

  1. 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 Infallible as the type which grants access to a helper operation for direct encoding without validation

    Decoded

    The domain-specific representation

  2. 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 Infallible as the type which grants access to a helper operation for direct decoding without validation

    Decoded

    The domain-specific representation

  3. 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

  1. object AsBytes
  2. object CryptoCodec
  3. object FromBytes
  4. object Int128Codec
  5. object StringDataTypesCodec
  6. object implicits extends Instances with ToOps with Instances with ToOps with CryptoCodecInstances with StringTypesInstances

Inherited from AnyRef

Inherited from Any

Ungrouped