gi-soup-2.4.18: Libsoup bindings

CopyrightWill Thompson Iñaki García Etxebarria and Jonas Platte
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria (inaki@blueleaf.cc)
Safe HaskellNone
LanguageHaskell2010

GI.Soup.Objects.MultipartInputStream

Contents

Description

No description available in the introspection data.

Synopsis

Exported types

class (GObject o, IsDescendantOf MultipartInputStream o) => IsMultipartInputStream o Source #

Type class for types which can be safely cast to MultipartInputStream, for instance with toMultipartInputStream.

toMultipartInputStream :: (MonadIO m, IsMultipartInputStream o) => o -> m MultipartInputStream Source #

Cast to MultipartInputStream, for types for which this is known to be safe. For general casts, use castTo.

Methods

getHeaders

multipartInputStreamGetHeaders Source #

Arguments

:: (HasCallStack, MonadIO m, IsMultipartInputStream a) 
=> a

multipart: a MultipartInputStream.

-> m (Maybe MessageHeaders)

Returns: a MessageHeaders containing the headers for the part currently being processed or Nothing if the headers failed to parse.

Obtains the headers for the part currently being processed. Note that the MessageHeaders that are returned are owned by the MultipartInputStream and will be replaced when a call is made to multipartInputStreamNextPart or its async counterpart, so if keeping the headers is required, a copy must be made.

Note that if a part had no headers at all an empty MessageHeaders will be returned.

Since: 2.40

new

multipartInputStreamNew Source #

Arguments

:: (HasCallStack, MonadIO m, IsMessage a, IsInputStream b) 
=> a

msg: the Message the response is related to.

-> b

baseStream: the InputStream returned by sending the request.

-> m MultipartInputStream

Returns: a new MultipartInputStream

Creates a new MultipartInputStream that wraps the InputStream obtained by sending the Request. Reads should not be done directly through this object, use the input streams returned by multipartInputStreamNextPart or its async counterpart instead.

Since: 2.40

nextPart

multipartInputStreamNextPart Source #

Arguments

:: (HasCallStack, MonadIO m, IsMultipartInputStream a, IsCancellable b) 
=> a

multipart: the MultipartInputStream

-> Maybe b

cancellable: a Cancellable

-> m (Maybe InputStream)

Returns: a new InputStream, or Nothing if there are no more parts (Can throw GError)

Obtains an input stream for the next part. When dealing with a multipart response the input stream needs to be wrapped in a MultipartInputStream and this function or its async counterpart need to be called to obtain the first part for reading.

After calling this function, multipartInputStreamGetHeaders can be used to obtain the headers for the first part. A read of 0 bytes indicates the end of the part; a new call to this function should be done at that point, to obtain the next part.

Since: 2.40

nextPartAsync

multipartInputStreamNextPartAsync Source #

Arguments

:: (HasCallStack, MonadIO m, IsMultipartInputStream a, IsCancellable b) 
=> a

multipart: the MultipartInputStream.

-> Int32

ioPriority: the I/O priority for the request.

-> Maybe b

cancellable: a Cancellable.

-> Maybe AsyncReadyCallback

callback: callback to call when request is satisfied.

-> m () 

Obtains a InputStream for the next request. See multipartInputStreamNextPart for details on the workflow.

Since: 2.40

nextPartFinish

multipartInputStreamNextPartFinish Source #

Arguments

:: (HasCallStack, MonadIO m, IsMultipartInputStream a, IsAsyncResult b) 
=> a

multipart: a MultipartInputStream.

-> b

result: a AsyncResult.

-> m (Maybe InputStream)

Returns: a newly created InputStream for reading the next part or Nothing if there are no more parts. (Can throw GError)

Finishes an asynchronous request for the next part.

Since: 2.40

Properties

message

No description available in the introspection data.

constructMultipartInputStreamMessage :: (IsMultipartInputStream o, IsMessage a) => a -> IO (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “message” property. This is rarely needed directly, but it is used by new.

getMultipartInputStreamMessage :: (MonadIO m, IsMultipartInputStream o) => o -> m (Maybe Message) Source #

Get the value of the “message” property. When overloading is enabled, this is equivalent to

get multipartInputStream #message