gi-soup-2.4.23: Libsoup bindings
CopyrightWill Thompson Iñaki García Etxebarria and Jonas Platte
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellNone
LanguageHaskell2010

GI.Soup.Objects.ContentSniffer

Description

No description available in the introspection data.

Synopsis

Exported types

newtype ContentSniffer Source #

Memory-managed wrapper type.

Constructors

ContentSniffer (ManagedPtr ContentSniffer) 

Instances

Instances details
Eq ContentSniffer Source # 
Instance details

Defined in GI.Soup.Objects.ContentSniffer

GObject ContentSniffer Source # 
Instance details

Defined in GI.Soup.Objects.ContentSniffer

ManagedPtrNewtype ContentSniffer Source # 
Instance details

Defined in GI.Soup.Objects.ContentSniffer

TypedObject ContentSniffer Source # 
Instance details

Defined in GI.Soup.Objects.ContentSniffer

Methods

glibType :: IO GType

IsGValue ContentSniffer Source #

Convert ContentSniffer to and from GValue with toGValue and fromGValue.

Instance details

Defined in GI.Soup.Objects.ContentSniffer

Methods

toGValue :: ContentSniffer -> IO GValue

fromGValue :: GValue -> IO ContentSniffer

HasParentTypes ContentSniffer Source # 
Instance details

Defined in GI.Soup.Objects.ContentSniffer

type ParentTypes ContentSniffer Source # 
Instance details

Defined in GI.Soup.Objects.ContentSniffer

type ParentTypes ContentSniffer = '[Object, SessionFeature]

class (GObject o, IsDescendantOf ContentSniffer o) => IsContentSniffer o Source #

Type class for types which can be safely cast to ContentSniffer, for instance with toContentSniffer.

Instances

Instances details
(GObject o, IsDescendantOf ContentSniffer o) => IsContentSniffer o Source # 
Instance details

Defined in GI.Soup.Objects.ContentSniffer

toContentSniffer :: (MonadIO m, IsContentSniffer o) => o -> m ContentSniffer Source #

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

Methods

Overloaded methods

getBufferSize

contentSnifferGetBufferSize Source #

Arguments

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

sniffer: a ContentSniffer

-> m Word64

Returns: the number of bytes to sniff

Gets the number of bytes sniffer needs in order to properly sniff a buffer.

Since: 2.28

new

contentSnifferNew Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> m ContentSniffer

Returns: a new ContentSniffer

Creates a new ContentSniffer.

Since: 2.28

sniff

contentSnifferSniff Source #

Arguments

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

sniffer: a ContentSniffer

-> b

msg: the message to sniff

-> Buffer

buffer: a buffer containing the start of msg's response body

-> m (Text, Map Text Text)

Returns: the sniffed Content-Type of buffer; this will never be Nothing, but may be "application/octet-stream".

Sniffs buffer to determine its Content-Type. The result may also be influenced by the Content-Type declared in msg's response headers.

Since: 2.28