-- 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.3.0 module Extism -- | Result type type Result a = Either Error a -- | Extism error newtype Error ExtismError :: String -> Error -- | Context for managing plugins newtype Context Context :: ForeignPtr ExtismContext -> Context -- | Plugins can be used to call WASM function data Plugin Plugin :: Context -> Int32 -> Plugin data CancelHandle CancelHandle :: Ptr ExtismCancelHandle -> CancelHandle -- | Log level data LogLevel Error :: LogLevel Warn :: LogLevel Info :: LogLevel Debug :: LogLevel Trace :: LogLevel -- | Free a Plugin, this will automatically be called for every -- plugin | associated with a Context when that Context is -- freed free :: Plugin -> IO () -- | Remove all registered plugins in a Context reset :: Context -> IO () -- | Helper function to convert a ByteString to a String fromByteString :: ByteString -> String -- | Update a Plugin with a new WASM module update :: Plugin -> ByteString -> Bool -> IO (Result ()) -- | Check if a Plugin is valid isValid :: Plugin -> Bool -- | Helper function to convert a String to a ByteString toByteString :: String -> ByteString -- | Get the Extism version string extismVersion :: () -> IO String -- | 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 with its own Context createPlugin :: ByteString -> Bool -> IO (Result Plugin) -- | Create a Plugin from a Manifest pluginFromManifest :: Context -> Manifest -> Bool -> IO (Result Plugin) -- | Create a Plugin with its own Context from a -- Manifest createPluginFromManifest :: Manifest -> Bool -> IO (Result Plugin) -- | Update a Plugin with a new Manifest updateManifest :: Plugin -> Manifest -> Bool -> IO (Result ()) -- | 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) cancelHandle :: Plugin -> IO CancelHandle cancel :: CancelHandle -> IO Bool data () => Manifest toString :: JSON a => a -> String instance GHC.Show.Show Extism.LogLevel instance GHC.Show.Show Extism.Error