t

com.digitalasset.canton.serialization

MemoizedEvidenceWithFailure

trait MemoizedEvidenceWithFailure[SerializationError] extends HasCryptographicEvidence with NoCopy

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 equals Some(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.

Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. MemoizedEvidenceWithFailure
  2. NoCopy
  3. HasCryptographicEvidence
  4. AnyRef
  5. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Abstract Value Members

  1. abstract def deserializedFrom: Option[ByteString]

    Returns the com.google.protobuf.ByteString from which this object has been deserialized, if any.

    Returns the com.google.protobuf.ByteString from which this object has been deserialized, if any. If defined, getCryptographicEvidence will use this as the serialization.

    Attributes
    protected[this]
  2. abstract def toByteStringChecked: Either[SerializationError, ByteString]

    Computes the serialization of the object as a com.google.protobuf.ByteString or produces a SerializationError if serialization fails.

    Computes the serialization of the object as a com.google.protobuf.ByteString or produces a SerializationError if serialization fails.

    Must meet the contract of getCryptographicEvidence except that different com.google.protobuf.ByteStrings may be returned when called several times and it may fail at any time.

    Attributes
    protected[this]

Concrete Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native() @IntrinsicCandidate()
  6. def copy(nothing: Nothing): Nothing
    Attributes
    protected
    Definition Classes
    NoCopy
  7. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  8. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  9. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @IntrinsicCandidate()
  10. final val getCryptographicEvidence: ByteString

    Returns the serialization of the object into a com.google.protobuf.ByteString.

    Returns the serialization of the object into a com.google.protobuf.ByteString. In particular, every instance i of this trait must equal fromByteString(i.toByteString).

    This method must yield the same result if it is invoked several times.

    Definition Classes
    MemoizedEvidenceWithFailureHasCryptographicEvidence
    Annotations
    @throws(scala.this.throws.<init>$default$1[com.digitalasset.canton.serialization.SerializationCheckFailed[SerializationError]])
  11. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @IntrinsicCandidate()
  12. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  13. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  14. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @IntrinsicCandidate()
  15. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @IntrinsicCandidate()
  16. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  17. def toString(): String
    Definition Classes
    AnyRef → Any
  18. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  19. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  20. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated @Deprecated
    Deprecated

Inherited from NoCopy

Inherited from AnyRef

Inherited from Any

Ungrouped