Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Cardano.Api.SerialiseTextEnvelope
Contents
Description
TextEnvelope Serialisation
Synopsis
- data FromSomeType (c ∷ Type → Constraint) b where
- FromSomeType ∷ c a ⇒ AsType a → (a → b) → FromSomeType c b
- class SerialiseAsCBOR a ⇒ HasTextEnvelope a where
- data TextEnvelope = TextEnvelope {}
- newtype TextEnvelopeDescr = TextEnvelopeDescr String
- data TextEnvelopeError
- newtype TextEnvelopeType = TextEnvelopeType String
- deserialiseFromTextEnvelope ∷ HasTextEnvelope a ⇒ AsType a → TextEnvelope → Either TextEnvelopeError a
- deserialiseFromTextEnvelopeAnyOf ∷ [FromSomeType HasTextEnvelope b] → TextEnvelope → Either TextEnvelopeError b
- readFileTextEnvelope ∷ HasTextEnvelope a ⇒ AsType a → FilePath → IO (Either (FileError TextEnvelopeError) a)
- readFileTextEnvelopeAnyOf ∷ [FromSomeType HasTextEnvelope b] → FilePath → IO (Either (FileError TextEnvelopeError) b)
- readTextEnvelopeFromFile ∷ FilePath → IO (Either (FileError TextEnvelopeError) TextEnvelope)
- readTextEnvelopeOfTypeFromFile ∷ TextEnvelopeType → FilePath → IO (Either (FileError TextEnvelopeError) TextEnvelope)
- serialiseToTextEnvelope ∷ ∀ a. HasTextEnvelope a ⇒ Maybe TextEnvelopeDescr → a → TextEnvelope
- data family AsType t
Documentation
data FromSomeType (c ∷ Type → Constraint) b where Source #
Constructors
FromSomeType ∷ c a ⇒ AsType a → (a → b) → FromSomeType c b |
class SerialiseAsCBOR a ⇒ HasTextEnvelope a where Source #
Minimal complete definition
Methods
Instances
data TextEnvelope Source #
A TextEnvelope
is a structured envelope for serialised binary values
with an external format with a semi-readable textual format.
It contains a "type" field, e.g. "PublicKeyByron" or "TxSignedShelley" to indicate the type of the encoded data. This is used as a sanity check and to help readers.
It also contains a "title" field which is free-form, and could be used to indicate the role or purpose to a reader.
Constructors
TextEnvelope | |
Fields |
Instances
newtype TextEnvelopeDescr Source #
Constructors
TextEnvelopeDescr String |
Instances
FromJSON TextEnvelopeDescr Source # | |
Defined in Cardano.Api.SerialiseTextEnvelope | |
ToJSON TextEnvelopeDescr Source # | |
Defined in Cardano.Api.SerialiseTextEnvelope Methods toJSON ∷ TextEnvelopeDescr → Value Source # toEncoding ∷ TextEnvelopeDescr → Encoding Source # toJSONList ∷ [TextEnvelopeDescr] → Value Source # | |
IsString TextEnvelopeDescr Source # | |
Defined in Cardano.Api.SerialiseTextEnvelope Methods | |
Semigroup TextEnvelopeDescr Source # | |
Defined in Cardano.Api.SerialiseTextEnvelope Methods (<>) ∷ TextEnvelopeDescr → TextEnvelopeDescr → TextEnvelopeDescr # sconcat ∷ NonEmpty TextEnvelopeDescr → TextEnvelopeDescr # stimes ∷ Integral b ⇒ b → TextEnvelopeDescr → TextEnvelopeDescr # | |
Show TextEnvelopeDescr Source # | |
Defined in Cardano.Api.SerialiseTextEnvelope Methods showsPrec ∷ Int → TextEnvelopeDescr → ShowS # show ∷ TextEnvelopeDescr → String # showList ∷ [TextEnvelopeDescr] → ShowS # | |
Eq TextEnvelopeDescr Source # | |
Defined in Cardano.Api.SerialiseTextEnvelope Methods |
data TextEnvelopeError Source #
The errors that the pure TextEnvelope
parsing/decoding functions can return.
Constructors
TextEnvelopeTypeError ![TextEnvelopeType] !TextEnvelopeType | expected, actual |
TextEnvelopeDecodeError !DecoderError | |
TextEnvelopeAesonDecodeError !String |
Instances
Show TextEnvelopeError Source # | |
Defined in Cardano.Api.SerialiseTextEnvelope Methods showsPrec ∷ Int → TextEnvelopeError → ShowS # show ∷ TextEnvelopeError → String # showList ∷ [TextEnvelopeError] → ShowS # | |
Eq TextEnvelopeError Source # | |
Defined in Cardano.Api.SerialiseTextEnvelope Methods | |
Error TextEnvelopeError Source # | |
Defined in Cardano.Api.SerialiseTextEnvelope Methods |
newtype TextEnvelopeType Source #
Constructors
TextEnvelopeType String |
Instances
deserialiseFromTextEnvelope ∷ HasTextEnvelope a ⇒ AsType a → TextEnvelope → Either TextEnvelopeError a Source #
deserialiseFromTextEnvelopeAnyOf ∷ [FromSomeType HasTextEnvelope b] → TextEnvelope → Either TextEnvelopeError b Source #
readFileTextEnvelope ∷ HasTextEnvelope a ⇒ AsType a → FilePath → IO (Either (FileError TextEnvelopeError) a) Source #
readFileTextEnvelopeAnyOf ∷ [FromSomeType HasTextEnvelope b] → FilePath → IO (Either (FileError TextEnvelopeError) b) Source #
readTextEnvelopeFromFile ∷ FilePath → IO (Either (FileError TextEnvelopeError) TextEnvelope) Source #
readTextEnvelopeOfTypeFromFile ∷ TextEnvelopeType → FilePath → IO (Either (FileError TextEnvelopeError) TextEnvelope) Source #
serialiseToTextEnvelope ∷ ∀ a. HasTextEnvelope a ⇒ Maybe TextEnvelopeDescr → a → TextEnvelope Source #
Data family instances
A family of singleton types used in this API to indicate which type to use where it would otherwise be ambiguous or merely unclear.
Values of this type are passed to deserialisation functions for example.