given_ByteDecoder_BlockHeader
org.sigilaris.node.jvm.runtime.consensus.hotstuff.SnapshotCodecs$package.given_ByteDecoder_BlockHeader
object given_ByteDecoder_BlockHeader extends ByteDecoder[BlockHeader]
Attributes
- Source
- SnapshotCodecs.scala
- Graph
-
- Supertypes
- Self type
Members list
Value members
Concrete methods
Decodes bytes to a value.
Decodes bytes to a value.
Value parameters
- bytes
-
the byte sequence to decode
Attributes
- Returns
-
Either failure or decoded value with remainder
- Definition Classes
- Source
- SnapshotCodecs.scala
Inherited methods
Creates a new decoder with validation.
Creates a new decoder with validation.
Value parameters
- f
-
function that may fail with DecodeFailure
Attributes
- Returns
-
new decoder for type B
- Example
-
val positiveDecoder = ByteDecoder[Long].emap { n => Either.cond(n > 0, n, DecodeFailure("Must be positive")) } - Inherited from:
- ByteDecoder
- Source
- ByteDecoder.scala
Creates a new decoder by chaining decoders.
Creates a new decoder by chaining decoders.
Value parameters
- f
-
function that creates a decoder based on decoded value
Attributes
- Returns
-
new decoder for type B
- Inherited from:
- ByteDecoder
- Source
- ByteDecoder.scala
Creates a new decoder by transforming the decoded value.
Creates a new decoder by transforming the decoded value.
Value parameters
- f
-
function to transform decoded value
Attributes
- Returns
-
new decoder for type B
- Inherited from:
- ByteDecoder
- Source
- ByteDecoder.scala
Widens the decoder to a supertype.
Widens the decoder to a supertype.
Type parameters
- AA
-
the supertype
Attributes
- Returns
-
a decoder for the wider type
- Inherited from:
- ByteDecoder
- Source
- ByteDecoder.scala
In this article