-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/
-- | Extism bindings
--
-- Bindings to Extism, the universal plugin system
@package extism
@version 0.2.0
module Extism
-- | Result type
type Result a = Either Error a
-- | Extism error
newtype Error
ExtismError :: String -> Error
-- | Log level
data LogLevel
Error :: LogLevel
Warn :: LogLevel
Info :: LogLevel
Debug :: LogLevel
Trace :: LogLevel
data CancelHandle
CancelHandle :: Ptr ExtismCancelHandle -> CancelHandle
-- | Plugins can be used to call WASM function
data Plugin
Plugin :: Context -> Int32 -> Plugin
-- | Context for managing plugins
newtype Context
Context :: ForeignPtr ExtismContext -> Context
-- | Helper function to convert a String to a ByteString
toByteString :: String -> ByteString
-- | Helper function to convert a ByteString to a String
fromByteString :: ByteString -> String
-- | Get the Extism version string
extismVersion :: () -> IO String
-- | Remove all registered plugins in a Context
reset :: Context -> IO ()
-- | Create a new Context
newContext :: IO Context
-- | Execute a function with a new Context that is destroyed when it
-- returns
withContext :: (Context -> IO a) -> IO a
-- | Create a Plugin from a WASM module, useWasi determines
-- if WASI should | be linked
plugin :: Context -> ByteString -> Bool -> IO (Result Plugin)
-- | Create a Plugin from a Manifest
pluginFromManifest :: Context -> Manifest -> Bool -> IO (Result Plugin)
-- | Update a Plugin with a new WASM module
update :: Plugin -> ByteString -> Bool -> IO (Result ())
-- | Update a Plugin with a new Manifest
updateManifest :: Plugin -> Manifest -> Bool -> IO (Result ())
-- | Check if a Plugin is valid
isValid :: Plugin -> Bool
-- | Set configuration values for a plugin
setConfig :: Plugin -> [(String, Maybe String)] -> IO Bool
levelStr :: LogLevel -> String
-- | Set the log file and level, this is a global configuration
setLogFile :: String -> LogLevel -> IO Bool
-- | Check if a function exists in the given plugin
functionExists :: Plugin -> String -> IO Bool
call :: Plugin -> String -> ByteString -> IO (Result ByteString)
-- | Free a Plugin, this will automatically be called for every
-- plugin | associated with a Context when that Context is
-- freed
free :: Plugin -> IO ()
cancelHandle :: Plugin -> IO CancelHandle
cancel :: CancelHandle -> IO Bool
toString :: JSON a => a -> String
data Manifest
instance GHC.Show.Show Extism.LogLevel
instance GHC.Show.Show Extism.Error