Copyright | Will Thompson Iñaki García Etxebarria and Jonas Platte |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria (garetxe@gmail.com) |
Safe Haskell | None |
Language | Haskell2010 |
GI.Soup.Objects.Cache
Contents
Description
- newtype Cache = Cache (ManagedPtr Cache)
- class GObject o => IsCache o
- toCache :: (MonadIO m, IsCache o) => o -> m Cache
- noCache :: Maybe Cache
- cacheClear :: (HasCallStack, MonadIO m, IsCache a) => a -> m ()
- cacheDump :: (HasCallStack, MonadIO m, IsCache a) => a -> m ()
- cacheFlush :: (HasCallStack, MonadIO m, IsCache a) => a -> m ()
- cacheGetMaxSize :: (HasCallStack, MonadIO m, IsCache a) => a -> m Word32
- cacheLoad :: (HasCallStack, MonadIO m, IsCache a) => a -> m ()
- cacheNew :: (HasCallStack, MonadIO m) => Text -> CacheType -> m Cache
- cacheSetMaxSize :: (HasCallStack, MonadIO m, IsCache a) => a -> Word32 -> m ()
- constructCacheCacheDir :: IsCache o => Text -> IO (GValueConstruct o)
- getCacheCacheDir :: (MonadIO m, IsCache o) => o -> m (Maybe Text)
- constructCacheCacheType :: IsCache o => CacheType -> IO (GValueConstruct o)
- getCacheCacheType :: (MonadIO m, IsCache o) => o -> m CacheType
Exported types
Constructors
Cache (ManagedPtr Cache) |
Methods
clear
Arguments
:: (HasCallStack, MonadIO m, IsCache a) | |
=> a |
|
-> m () |
Will remove all entries in the cache
plus all the cache files.
Since: 2.34
dump
Arguments
:: (HasCallStack, MonadIO m, IsCache a) | |
=> a |
|
-> m () |
Synchronously writes the cache index out to disk. Contrast with
cacheFlush
, which writes pending cache
<emphasis>entries</emphasis> to disk.
You must call this before exiting if you want your cache data to persist between sessions.
@since 2.34.
flush
Arguments
:: (HasCallStack, MonadIO m, IsCache a) | |
=> a |
|
-> m () |
This function will force all pending writes in the cache
to be
committed to disk. For doing so it will iterate the MainContext
associated with cache
's session as long as needed.
Contrast with cacheDump
, which writes out the cache index
file.
Since: 2.34
getMaxSize
Arguments
:: (HasCallStack, MonadIO m, IsCache a) | |
=> a |
|
-> m Word32 | Returns: the maximum size of the cache, in bytes. |
Gets the maximum size of the cache.
Since: 2.34
load
Arguments
:: (HasCallStack, MonadIO m, IsCache a) | |
=> a |
|
-> m () |
Loads the contents of cache
's index into memory.
Since: 2.34
new
Arguments
:: (HasCallStack, MonadIO m) | |
=> Text |
|
-> CacheType |
|
-> m Cache | Returns: a new |
Creates a new Cache
.
Since: 2.34
setMaxSize
Arguments
:: (HasCallStack, MonadIO m, IsCache a) | |
=> a |
|
-> Word32 |
|
-> m () |
Sets the maximum size of the cache.
Since: 2.34
Properties
cacheDir
constructCacheCacheDir :: IsCache o => Text -> IO (GValueConstruct o) Source #
cacheType
constructCacheCacheType :: IsCache o => CacheType -> IO (GValueConstruct o) Source #