| Copyright | (c) 2012-2013 The leveldb-haskell Authors | 
|---|---|
| License | BSD3 | 
| Maintainer | kim.altintop@gmail.com | 
| Stability | experimental | 
| Portability | non-portable | 
| Safe Haskell | None | 
| Language | Haskell2010 | 
Database.LevelDB.Internal
Description
- data DB = DB LevelDBPtr Options' (IORef Bool)
- data Comparator'
- data FilterPolicy'
- data Options' = Options' {- _optsPtr :: !OptionsPtr
- _cachePtr :: !(Maybe CachePtr)
- _comp :: !(Maybe Comparator')
- _fpPtr :: !(Maybe (Either FilterPolicyPtr FilterPolicy'))
 
- unsafeClose :: DB -> IO ()
- freeCReadOpts :: ReadOptionsPtr -> IO ()
- freeComparator :: Comparator' -> IO ()
- freeFilterPolicy :: FilterPolicy' -> IO ()
- freeOpts :: Options' -> IO ()
- mkCReadOpts :: ReadOptions -> IO ReadOptionsPtr
- mkComparator :: String -> (ByteString -> ByteString -> Ordering) -> IO Comparator'
- mkCompareFun :: (ByteString -> ByteString -> Ordering) -> CompareFun
- mkCreateFilterFun :: ([ByteString] -> ByteString) -> CreateFilterFun
- mkFilterPolicy :: FilterPolicy -> IO FilterPolicy'
- mkKeyMayMatchFun :: (ByteString -> ByteString -> Bool) -> KeyMayMatchFun
- mkOpts :: Options -> IO Options'
- withCWriteOpts :: WriteOptions -> (WriteOptionsPtr -> IO a) -> IO a
- withCReadOpts :: ReadOptions -> (ReadOptionsPtr -> IO a) -> IO a
- throwIfErr :: String -> (ErrPtr -> IO a) -> IO a
- cSizeToInt :: CSize -> Int
- intToCSize :: Int -> CSize
- intToCInt :: Int -> CInt
- cIntToInt :: CInt -> Int
- boolToNum :: Num b => Bool -> b
Types
Database handle
Constructors
| DB LevelDBPtr Options' (IORef Bool) | 
data Comparator' Source #
Internal representation of a Comparator
data FilterPolicy' Source #
Internal representation of a FilterPolicy
Internal representation of the Options
Constructors
| Options' | |
| Fields 
 | |
unsafeClose :: DB -> IO () Source #
Closes the database.
The function is safe in that it doesn't double-free the pointer, but is
 unsafe because other functions which use the DB handle do not check if
 the handle is live. If the handle is used after it was freed, the program
 will segfault (internally, leveldb performs a delete on the pointer).
"Smart" constructors and deconstructors
freeCReadOpts :: ReadOptionsPtr -> IO () Source #
freeComparator :: Comparator' -> IO () Source #
freeFilterPolicy :: FilterPolicy' -> IO () Source #
mkComparator :: String -> (ByteString -> ByteString -> Ordering) -> IO Comparator' Source #
mkCompareFun :: (ByteString -> ByteString -> Ordering) -> CompareFun Source #
mkCreateFilterFun :: ([ByteString] -> ByteString) -> CreateFilterFun Source #
mkKeyMayMatchFun :: (ByteString -> ByteString -> Bool) -> KeyMayMatchFun Source #
combinators
withCWriteOpts :: WriteOptions -> (WriteOptionsPtr -> IO a) -> IO a Source #
withCReadOpts :: ReadOptions -> (ReadOptionsPtr -> IO a) -> IO a Source #
Utilities
cSizeToInt :: CSize -> Int Source #
intToCSize :: Int -> CSize Source #