Copyright | Will Thompson Iñaki García Etxebarria and Jonas Platte |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria (inaki@blueleaf.cc) |
Safe Haskell | None |
Language | Haskell2010 |
No description available in the introspection data.
Synopsis
- newtype ContentSniffer = ContentSniffer (ManagedPtr ContentSniffer)
- class (GObject o, IsDescendantOf ContentSniffer o) => IsContentSniffer o
- toContentSniffer :: (MonadIO m, IsContentSniffer o) => o -> m ContentSniffer
- noContentSniffer :: Maybe ContentSniffer
- contentSnifferGetBufferSize :: (HasCallStack, MonadIO m, IsContentSniffer a) => a -> m Word64
- contentSnifferNew :: (HasCallStack, MonadIO m) => m ContentSniffer
- contentSnifferSniff :: (HasCallStack, MonadIO m, IsContentSniffer a, IsMessage b) => a -> b -> Buffer -> m (Text, Map Text Text)
Exported types
newtype ContentSniffer Source #
Memory-managed wrapper type.
Instances
GObject ContentSniffer Source # | |
Defined in GI.Soup.Objects.ContentSniffer gobjectType :: IO GType # | |
HasParentTypes ContentSniffer Source # | |
Defined in GI.Soup.Objects.ContentSniffer | |
type ParentTypes ContentSniffer Source # | |
Defined in GI.Soup.Objects.ContentSniffer |
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
(GObject o, IsDescendantOf ContentSniffer o) => IsContentSniffer o Source # | |
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
.
noContentSniffer :: Maybe ContentSniffer Source #
A convenience alias for Nothing
:: Maybe
ContentSniffer
.
Methods
getBufferSize
contentSnifferGetBufferSize Source #
:: (HasCallStack, MonadIO m, IsContentSniffer a) | |
=> a |
|
-> 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
:: (HasCallStack, MonadIO m) | |
=> m ContentSniffer | Returns: a new |
Creates a new ContentSniffer
.
Since: 2.28
sniff
:: (HasCallStack, MonadIO m, IsContentSniffer a, IsMessage b) | |
=> a |
|
-> b |
|
-> Buffer |
|
-> m (Text, Map Text Text) | Returns: the sniffed Content-Type of |
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