trait Encoder[-A] extends AnyRef
Supports encoding a value of type A
to a BitVector
.
- Self Type
- Encoder[A]
- Source
- Encoder.scala
- Alphabetic
- By Inheritance
- Encoder
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Abstract Value Members
-
abstract
def
encode(value: A): Attempt[BitVector]
Attempts to encode the specified value in to a bit vector.
Attempts to encode the specified value in to a bit vector.
- value
value to encode
- returns
error or binary encoding of the value
-
abstract
def
sizeBound: SizeBound
Provides a bound on the size of successfully encoded values.
Concrete Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
asEncoder: Encoder[A]
Gets this as an
Encoder
. -
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
def
compact: Encoder[A]
Converts this encoder to a new encoder that compacts the generated bit vector before returning it
-
def
contramap[B](f: (B) ⇒ A): Encoder[B]
Converts this encoder to an
Encoder[B]
using the suppliedB => A
. -
def
econtramap[B](f: (B) ⇒ Attempt[A]): Encoder[B]
Converts this encoder to an
Encoder[B]
using the suppliedB => Attempt[A]
. -
def
encodeOnly: Codec[A]
Converts this to a codec that fails decoding with an error.
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
def
pcontramap[B](f: (B) ⇒ Option[A]): Encoder[B]
Converts this encoder to an
Encoder[B]
using the supplied partial function fromB
toA
.Converts this encoder to an
Encoder[B]
using the supplied partial function fromB
toA
. The encoding will fail for anyB
thatf
maps toNone
. -
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()