All Downloads are FREE. Search and download functionalities are using the official Maven repository.

scodec.codecs.FailCodec.scala Maven / Gradle / Ivy

There is a newer version: 1.11.3
Show newest version
package scodec
package codecs

import scodec.bits.BitVector

private[codecs] final class FailCodec[A](encErr: Err, decErr: Err) extends Codec[A] {

  override def sizeBound = SizeBound.unknown

  override def encode(a: A) = Attempt.failure(encErr)

  override def decode(b: BitVector) = Attempt.failure(decErr)

  override def toString = "fail"
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy