cardano-api:internal
Safe HaskellNone
LanguageHaskell2010

Cardano.Api.DeserialiseAnyOf

Description

Class of errors used in the Api.

Synopsis

Documentation

data InputFormat a where Source #

Input format/encoding.

Constructors

InputFormatBech32 :: forall a. SerialiseAsBech32 a => InputFormat a

Bech32 encoding.

InputFormatHex :: forall a. SerialiseAsRawBytes a => InputFormat a

Hex/Base16 encoding.

InputFormatTextEnvelope :: forall a. HasTextEnvelope a => InputFormat a

Text envelope format.

data InputDecodeError Source #

Input decoding error.

Constructors

InputTextEnvelopeError !TextEnvelopeError

The provided data seems to be a valid text envelope, but some error occurred in deserialising it.

InputBech32DecodeError !Bech32DecodeError

The provided data is valid Bech32, but some error occurred in deserialising it.

InputInvalidError

The provided data does not represent a valid value of the provided type.

Instances

Instances details
Data InputDecodeError Source # 
Instance details

Defined in Cardano.Api.DeserialiseAnyOf

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> InputDecodeError -> c InputDecodeError Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c InputDecodeError Source #

toConstr :: InputDecodeError -> Constr Source #

dataTypeOf :: InputDecodeError -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c InputDecodeError) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c InputDecodeError) Source #

gmapT :: (forall b. Data b => b -> b) -> InputDecodeError -> InputDecodeError Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> InputDecodeError -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> InputDecodeError -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> InputDecodeError -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> InputDecodeError -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> InputDecodeError -> m InputDecodeError Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> InputDecodeError -> m InputDecodeError Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> InputDecodeError -> m InputDecodeError Source #

Show InputDecodeError Source # 
Instance details

Defined in Cardano.Api.DeserialiseAnyOf

Error InputDecodeError Source # 
Instance details

Defined in Cardano.Api.DeserialiseAnyOf

Eq InputDecodeError Source # 
Instance details

Defined in Cardano.Api.DeserialiseAnyOf

deserialiseInput :: AsType a -> NonEmpty (InputFormat a) -> ByteString -> Either InputDecodeError a Source #

Deserialise an input of some type that is formatted in some way.

deserialiseInputAnyOf :: [FromSomeType SerialiseAsBech32 b] -> [FromSomeType HasTextEnvelope b] -> ByteString -> Either InputDecodeError b Source #

Deserialise an input of some type that is formatted in some way.

The provided ByteString can either be Bech32-encoded or in the text envelope format.

renderInputDecodeError :: InputDecodeError -> Doc ann Source #

Render an error message for a InputDecodeError.

mapSomeAddressVerificationKey :: (forall keyrole. Key keyrole => VerificationKey keyrole -> a) -> SomeAddressVerificationKey -> a Source #