purebred-email-0.6.0.2: types and parser for email messages (including MIME)
Safe HaskellSafe-Inferred
LanguageHaskell2010

Data.MIME.TransferEncoding

Description

MIME content transfer encodings.

Synopsis

Documentation

class HasTransferEncoding a where Source #

Data types that can have transfer encoding.

Associated Types

type TransferDecoded a Source #

Methods

transferEncodingName :: Getter a TransferEncodingName Source #

Get the declared or default transfer encoding name.

transferEncodedData :: Getter a ByteString Source #

Return the encoded data in the structure.

transferDecoded :: (AsTransferEncodingError e, Profunctor p, Contravariant f) => Optic' p f a (Either e (TransferDecoded a)) Source #

Perform content transfer decoding.

transferDecoded' :: (Profunctor p, Contravariant f) => Optic' p f a (Either TransferEncodingError (TransferDecoded a)) Source #

Perform content transfer decoding (monomorphic error type).

transferEncode :: TransferDecoded a -> a Source #

Encode the data

transferDecodedBytes :: (HasTransferEncoding a, AsTransferEncodingError e, Profunctor p, Contravariant f) => Optic' p f a (Either e ByteString) Source #

Decode the object according to the declared content transfer encoding.

transferEncodings :: [(CI ByteString, TransferEncoding)] Source #

Get the Content-Transfer-Encoding for an entity. Defaults to 7bit (RFC 2045 §6.1) if the header is not present. Fails on unrecognised values.

chooseTransferEncoding :: ByteString -> (TransferEncodingName, TransferEncoding) Source #

Inspect the data and choose a transfer encoding to use: 7bit if the data can be transmitted as-is, otherwise whichever of quoted-printable or base64 should result in smaller output.