h&/,7      !"#$%&'()*+,-./0123456  Safe-Inferred")*/12589:;<=?r7borshBit-for-bit copy from a to b87 Safe-Inferred")*/12589:;<=?09borshLittle Endian value:borsh8Convert from a little endian value to the cpu endianness;<9=>: Safe-Inferred")*/12589:;<=?f?borsh#Peek at the start of the bytestringIf the bytestring is long enough, returns the value, the size of that value, and the remaining bytes.4Implementation note: this could be simplified using bytestring >= 0.11 , as the offset argument has been removed. As it stands, this implementation is backwards compatible.@borshO(1) splitAtEnd n xs is equivalent to (takeEnd n xs, dropEnd n xs) splitAtEnd 0 "abcde" == ("abcde", "") splitAtEnd 1 "abcde" == ("abcd", "e") splitAtEnd 5 "abcde" == ("", "abcde")$Edge cases, similar to behaviour of A:BborshWrapper around C with more sane return typeDborshWrapper around E with more sane return type?@BD Safe-Inferred")*/12589:;<=?Fborsh/Bunch of chunks, starting at a particular pointThe chunks are stored in reverse order, and we cache their total length.Gborsh>The most common case: chunk of the input at a particular pointHborsh(Value at a particular point in the inputIborsh Offset in bytes within the inputJborshConcatenate all chunks togetherNOTE: This is expensive, and should be used only in exception circumstances.Kborsh Add chunkThis does not affect the offset, since the chunk is (logically) at the end of the already-known chunksLborshSplit chunks at the required length, if sufficient chunks are availablePrecondition: if the accumulated length exceeds the required length, we must be able to split the mostly added chunk to make up for the difference. FGHMINJKL Safe-Inferred")*/12589:;<=? borshError type for deserialisation.OborshMonad for incremental decoding Think of O= as the monad we use for processing the full input, whereas Decoder> is the monad used for processing a single chunk of the input.borsh5The position of the decoder when the failure occurredborshMessage explaining the failurePQRSOTUVWXYZ  Safe-Inferred#)*/12589:;<=?[borsh9The decoder terminated successfully: we can stop decoding\borsh#The decoder failed: we should abort]borsh2The decoder needs more data before it can continueNOTE: The decoder that is waiting for more data may not be (and typically will not be) the decoder we started with in ^: in the typical case, a bunch of values will have been decoded successfully before we get to a (continuation) decoder that requires data beyond the current chunk._borsh6Large token of known length that spans multiple chunksSee  for discussion.The continuation will be called with a lazy bytestring of precisely the requested length (provided enough input is available, of course), along with the remaining input token to be provided to the continuation decoder.`borshIncremental interfaceSee  for discussion.aborsh Variation on `$, where we do not accumulate resultsSee  for discussion.borshDecoderA decoder describes how to match against a single chunk of the input.&For decoders for primitive types, use   instances.borshLift an b operation into the  monad.cborshDecode a value encoded in little endian byte order (e.g. as mandated by the  https://borsh.ioBorsh spec).borsh6Large token of known length that spans multiple chunksThis is NOT incremental: all chunks will be read into memory before the result is returned. Primarily useful for large types that are not easily split into (valid) chunks, such as UTF8-encoded text (if were wanted to split that, we'd have to split it at UTF8 boundaries).borshIncremental interfaceWhen decoding large objects such as lists, we do not want to bring all required chunks into memory before decoding the list. Instead, we want to decode the list elements as we go. In this case, ` can be used to repeatedly decode a value using decoder for the elements.:NOTE: This interface is incremental in the sense that the  input chunks are read one at a time. It is NOT incremental in the generated output.borsh Variation on decoreIncremental$, where we do not accumulate resultsThis is useful for example for datatypes that we can update imperatively (using the b monad), such as mutable arrays. It could also be used to skip over unused parts of the input.dborshTop-level entry pointWe start without any input at all (and depending on the specific decoder, we may never need any).eborsh#Run decoder against specified chunkfborshProcess decoder resultgborsh Auxiliary to f): process token that spans multple chunksPrecondition: if the accumulated length exceeds the required length, we must be able to split the mostly added chunk to make up for the difference.hborsh Auxiliary to f: incremental decodingiborshImperative version of hSee a for discussion.borsh Run decoder _borshRequired number of bytes`borsh'How often to repeat the smaller decoderborshDecoder to repeatborshProcess all elementsaborsh'How often to repeat the smaller decoderborsh6Decoder to repeat (imperatively handling each element)borsh ContinuationborshNumber of bytes to decodeborsh,Number of elements in the sequence to decodeborsh# to run for the individual elementsborsh,Number of elements in the sequence to decodeborsh# to run for the individual elementsgborshRequired total sizeborsh Continuationborsh Current chunkhborshNumber of elements requiredborshDecoder to repeatborsh+Continuation once we processed all elementsborsh Current chunkiborshNumber of elements requiredborshDecoder to repeatborsh+Continuation once we processed all elementsborsh Current chunkborshDecoderborshInputborshLeft-over input, offset of the left-over input relative to the start, and the result.j[]_`a\k^c Safe-Inferred")*/12589:;<=?]  Safe-Inferred#)*/012589:;<=?l Safe-Inferred#)*/12589:;<=?borshMutable fixed-size arrays borshFixed size arraysFixedSizeArray n a. is the Haskell counter-part to the Rust type [A; N]..NOTE: For convenience, this is an instance of m, but the invariant that the length of the vector should never change is not currently checked. borsh Construct   from list of unknown sizeThrows an exception if the list does not have the right number of elements. borsh Construct   from array of unknown size>Throws an exception if the array does not have the right size.borsh Construct  # from mutable array of unknown size>Throws an exception if the array does not have the right size.borsh3Construct new mutable array of the appropriate size     Safe-Inferred")*/12589:;<=?borshEncoderAn encoder describes how to serialise a given value in BORSH format.nopqrstuvwxyz{|}~  Safe-Inferred")*/12589:;<=? T Safe-Inferred#)*/012589:;<=?+ borshAuxiliary class to  BorshSize describing the conditions under which the size of the encoding of a value of a sum-type is known.borshType-level composition of / and -borshA sum of products has known size if it has at most one constructor, and all arguments of that constructor have known sizeborsh Auxiliary to Defined in such a way that we know the result is of variable size as soon as we encounter the first type of variable size (independent of the tail).borshA product of types has known size if all types in the products doborsh Deriving-via support for structsUsage: data MyStruct = .. deriving (BorshSize, ToBorsh, FromBorsh) via AsStruct MyStructNOTE: Doing so may have consequences for forwards compatibility: if a tag is present, additional constructors can be added without invalidating the encoding of existing constructors. See also  . borsh-Deriving-via support for enums (general ADTs)The Borsh spec  https://borsh.io/ mandates that enums have a tag indicating the constructor, even when there is only a single constructor in the enum. In Rust this makes more sense than in Haskell, since in Rust enums and structs are introduced through different keywords. In Haskell, of course, the only difference between them is that a struct is an enum with a single constructor.*The generic encoder en decoder you get in % and # when deriving via AsEnum will therefore add the tag, independent of the number of constructors: data MyEnum = .. deriving (BorshSize, ToBorsh, FromBorsh) via AsEnum MyEnumIf you want the encoding of a struct, without the tag, you need to derive via .$borshDecode from Borsh.There is no generic default implementation of $"; instead use deriving-via using  or  .&borshEncoder to Borsh.There is no generic default implementation of &"; instead use deriving-via using  or  .'borshIf the size of a type's Borsh encoding is statically known then we also know the maximum size of the encoding. Useful for deriving-via.+borsh"Maximum size of the Borsh encoding.There is no generic default implementation of +"; instead use deriving-via using  or  .?@ABCDEBFGHIJKLMNOPMQORSTUVWXYZ[\]^_[`abcde f g h i j k lImn o p q r s t u v  wxyz { | } ~                                            "borsh-0.3.0-BrwUH0COzM9AIykjEuqcI0Codec.Borsh.IncrementalData.FixedSizeArray Codec.Borsh%Codec.Borsh.Internal.Util.BitwiseCast"Codec.Borsh.Internal.Util.ByteSwap$Codec.Borsh.Internal.Util.ByteStringCodec.Borsh.Incremental.LocatedCodec.Borsh.Incremental.MonadCodec.Borsh.Incremental.Decoder FromBorshCodec.Borsh.Internal.Util.SOPCodec.Borsh.EncodingCodec.Borsh.DecodingCodec.Borsh.ClassDeserialiseFailureDecoder liftDecoderdecodeLargeTokendecodeIncrementaldecodeIncremental_deserialiseByteStringMFixedSizeArraytoMArrayFixedSizeArraytoArrayfromList fromArray fromMArraynew$fVectorFixedSizeArraya$fTraversableFixedSizeArray$fMVectorMFixedSizeArraya$fShowFixedSizeArray$fEqFixedSizeArray$fOrdFixedSizeArray$fFunctorFixedSizeArray$fFoldableFixedSizeArrayEncoder runEncoder BorshSizeSum borshSizeSumAsStruct getStructAsEnumgetEnum decodeBorshToBorsh encodeBorshKnownImpliesMaxgetKnownImpliesMax BorshMaxSize borshMaxSize BorshSizeStaticBorshSize borshSizeSize SizeKnown SizeVariable KnownSize HasKnownSizeHasVariableSizeserialiseBorshdeserialiseBorshcastBits BitwiseCastLEfromLEByteSwapbyteSwapunLEpeekByteString splitAtEndbaseGHC.ListsplitAt lengthStrictbytestring-0.11.3.1Data.ByteStringlength lengthLazyData.ByteString.Lazy LocatedChunks LocatedChunkLocated ByteOffsetfromLocatedChunksaddChunk splitChunksLtoLocatedChunksIncrIDecode IDecodeDoneIDecodePartial IDecodeFailgetIncrrunIncrliftIncr needChunk decodeFail runIDecode DecodeDone DecodeFailDecodeNeedsData matchChunkDecodeLargeTokenDecodeIncrementalDecodeIncremental_GHC.STSTdecodeLittleEndian runDecoderrunWith processResultprocessLargeTokenprocessIncrementalprocessIncremental_ DecodeResultindices&vector-0.13.0.0-JKrBPPZBIK2JBM2KZEUb7ZData.Vector.Generic.BaseVectorencodeU8 encodeU16 encodeU32 encodeU64encodeI8 encodeI16 encodeI32 encodeI64 encodeF32 encodeF64 encodeU128 encodeI128 encodeString encodeArray encodeVec encodeOption encodeHashSet encodeHashMap encodeStruct encodeEnumencodeLazyByteStringencodeStrictByteString encodeChar encodeBooldecodeU8 decodeU16 decodeU32 decodeU64 decodeU128decodeI8 decodeI16 decodeI32 decodeI64 decodeI128 decodeF32 decodeF64 decodeString decodeArray decodeVec decodeOption decodeHashSet decodeHashMap decodeStruct decodeEnumdecodeLazyByteStringdecodeStrictByteString decodeChar decodeBoolSoK SumKnownSize ProdKnownAux ProdKnownSize