object DeterministicEncoding
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.
- Alphabetic
- By Inheritance
- DeterministicEncoding
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
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
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def checkBytePrefix(b: Byte, bytes: ByteString): Either[DeserializationError, ByteString]
Tests that the given com.google.protobuf.ByteString starts with the given byte and drops it.
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native() @HotSpotIntrinsicCandidate()
- def decodeBytes(bytes: ByteString): Either[DeserializationError, (ByteString, ByteString)]
Extract a byte-string (length stored) from another ByteString
- def decodeInstant(bytes: ByteString): Either[DeserializationError, (Instant, ByteString)]
Decode a java.time.Instant from a com.google.protobuf.ByteString and return the remainder of the com.google.protobuf.ByteString.
Decode a java.time.Instant from a com.google.protobuf.ByteString and return the remainder of the com.google.protobuf.ByteString.
Inverse to DeterministicEncoding.encodeInstant
- def decodeInt(bytes: ByteString): Either[DeserializationError, (Int, ByteString)]
Consume and decode a fixed-length big-endian scala.Int and return the remainder of the com.google.protobuf.ByteString.
Consume and decode a fixed-length big-endian scala.Int and return the remainder of the com.google.protobuf.ByteString.
Inverse to DeterministicEncoding.encodeInt
- def decodeLong(bytes: ByteString): Either[DeserializationError, (Long, ByteString)]
Decode a scala.Long from a com.google.protobuf.ByteString and return the remainder of the com.google.protobuf.ByteString.
Decode a scala.Long from a com.google.protobuf.ByteString and return the remainder of the com.google.protobuf.ByteString.
Inverse to DeterministicEncoding.encodeLong
- def decodeSeqWith[A](bytes: ByteString)(decode: (ByteString) => Either[DeserializationError, (A, ByteString)]): Either[DeserializationError, (Seq[A], ByteString)]
- def decodeString(bytes: ByteString): Either[DeserializationError, (String, ByteString)]
Decode a java.lang.String from a length-prefixed com.google.protobuf.ByteString and return the remainder of the com.google.protobuf.ByteString.
Decode a java.lang.String from a length-prefixed com.google.protobuf.ByteString and return the remainder of the com.google.protobuf.ByteString.
Inverse to DeterministicEncoding.encodeString
- def decodeUVarInt(bytes: ByteString): Either[DeserializationError, (Long, ByteString)]
Decodes a unsigned variable integer according to https://github.com/multiformats/unsigned-varint
- def encodeByte(b: Byte): ByteString
Encode a scala.Byte into a com.google.protobuf.ByteString.
- def encodeBytes(b: ByteString): ByteString
Encode a ByteString (of given length) into another ByteString
- def encodeEitherWith[L, R](either: Either[L, R])(encodeL: (L) => ByteString, encodeR: (R) => ByteString): ByteString
Encode an scala.Either of com.google.protobuf.ByteStrings into a tagged com.google.protobuf.ByteString.
- def encodeInstant(instant: Instant): ByteString
Encode an java.time.Instant into a com.google.protobuf.ByteString
- def encodeInt(i: Int): ByteString
Encode an scala.Int into a fixed-length com.google.protobuf.ByteString in big-endian order.
- def encodeLong(l: Long): ByteString
Encode a scala.Long into a fixed-length com.google.protobuf.ByteString in big-endian order.
- def encodeOptionWith[A](option: Option[A])(encode: (A) => ByteString): ByteString
Encode an scala.Option into a tagged com.google.protobuf.ByteString, using the given
encode
function. - def encodeParty(party: LfPartyId): ByteString
Encode an LfPartyId into a com.google.protobuf.ByteString, using the underlying string
- def encodeSeqWith[A](seq: Seq[A])(encode: (A) => ByteString): ByteString
Encode a scala.Seq into a com.google.protobuf.ByteString using the given encoding function, prefixing it with the length of the scala.Seq
- def encodeString(s: String): ByteString
Encode a java.lang.String into a com.google.protobuf.ByteString, prefixing the string content with its length.
- def encodeTuple2With[A, B](pair: (A, B))(encodeA: (A) => ByteString, encodeB: (B) => ByteString): ByteString
Encode a pair of com.google.protobuf.ByteStrings as an untagged com.google.protobuf.ByteString
- def encodeUVarInt(i: Long): ByteString
Encodes the scala.Long into a unsigned variable integer according to https://github.com/multiformats/unsigned-varint
Encodes the scala.Long into a unsigned variable integer according to https://github.com/multiformats/unsigned-varint
- Annotations
- @SuppressWarnings()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- 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() @HotSpotIntrinsicCandidate()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- def splitAt(len: Int, bytes: ByteString): Either[DeserializationError, (ByteString, ByteString)]
Tests that the given com.google.protobuf.ByteString has at least
len
bytes and splits the com.google.protobuf.ByteString atlen
. - def strictDeserializer[T](deserialize: (ByteString) => Either[DeserializationError, (T, ByteString)]): (ByteString) => Either[DeserializationError, T]
Wrapper to deserialize strictly, returning an error if there are trailing bytes
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])