package serialization
- Alphabetic
- Public
- Protected
Type Members
- final case class BytestringWithCryptographicEvidence(bytes: ByteString) extends HasCryptographicEvidence with Product with Serializable
Wraps a com.google.protobuf.ByteString so that it is its own cryptographic evidence.
- final case class DefaultDeserializationError(message: String) extends DeserializationError with Product with Serializable
- sealed trait DeserializationError extends PrettyPrinting
- trait HasCryptographicEvidence extends AnyRef
Trait for deterministically serializing an object to a com.google.protobuf.ByteString.
Trait for deterministically serializing an object to a com.google.protobuf.ByteString.
A class should extend this trait to indicate that the
serialize
method yields the sameByteString
if invoked several times. Typical use cases of this behavior include:- Classes that represent a leaf of a Merkle tree.
- Classes that represent content that is signed e.g. Hash or SignedProtocolMessageContent.
- Classes that are mere wrappers of ByteString (for convenience of the caller) e.g. AuthenticationToken.
If a class merely represents content that is transmitted over a network, the class does not need to extend this trait.
It is strongly recommended to extend this trait by mixing in ProtocolVersionedMemoizedEvidence or MemoizedEvidenceWithFailure, instead of directly extending this trait.
Classes
C
implementing HasCryptographicEvidence must define afromByteString: ByteString => C
method in their companion object that converts a serialization back into an equal object. In particular,c.fromByteString(byteString).toByteString
must equalbyteString
. - final case class MaxByteToDecompressExceeded(message: String) extends DeserializationError with Product with Serializable
- trait MemoizedEvidenceWithFailure[SerializationError] extends HasCryptographicEvidence with NoCopy
Effectively immutable HasCryptographicEvidence classes can mix in this trait to implement the memoization logic.
Effectively immutable HasCryptographicEvidence classes can mix in this trait to implement the memoization logic.
Use this class if serialization may fail. This mix-in checks whenever an object is constructed that either a serialization is given or that serialization will succeed. It also ensures that no
copy
method is generated for case classes with this mixin.Make sure that
fromByteString(byteString).deserializedFrom
equalsSome(byteString)
.Make sure that every public constructor and apply method yields an instance with
deserializedFrom == None
.- SerializationError
The type of serialization errors
- Exceptions thrown
SerializationCheckFailed
if the serialization fails- See also
MemoizedEvidence if serialization always succeeds.
- trait ProtoConverter[A, Proto, Err] extends AnyRef
Can convert messages to and from proto objects
Can convert messages to and from proto objects
- A
type of the message to be serialized
- Proto
type of the proto message
- Err
type of deserialization errors
- trait ProtocolVersionedMemoizedEvidence extends HasCryptographicEvidence with HasRepresentativeProtocolVersion
Effectively immutable HasCryptographicEvidence classes can mix in this trait to implement the memoization logic.
Effectively immutable HasCryptographicEvidence classes can mix in this trait to implement the memoization logic.
Use this class if serialization always succeeds.
Make sure that
fromByteString(byteString).deserializedFrom
equalsSome(byteString)
.Make sure that every public constructor and apply method yields an instance with
deserializedFrom == None
.- See also
MemoizedEvidenceWithFailure if serialization may fail
- final case class SerializationCheckFailed[+E](serializationError: E) extends Exception with Product with Serializable
Thrown by MemoizedEvidenceWithFailure classes during object construction if the serialization fails.
Thrown by MemoizedEvidenceWithFailure classes during object construction if the serialization fails.
- E
The type of errors that serialization may return
- serializationError
The error raised during the serialization
Value Members
- object DeterministicEncoding
The methods in this object should be used when a deterministic encoding is needed.
The methods in this object should be used when a deterministic encoding is needed. They are not meant for computing serializations for a wire format. Protobuf is a better choice there.
- object ProtoConverter