Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Extism.PDK
Description
Extism plugin development kit, used with the wasm32-wasi-ghc backend to make Extism plugins
Synopsis
- data LogLevel
- log :: LogLevel -> String -> IO ()
- tryInput :: FromBytes a => IO (Either String a)
- inputByteString :: IO ByteString
- input :: forall a. FromBytes a => IO a
- inputString :: IO String
- inputJSON :: JSON a => IO (Either String a)
- output :: ToBytes a => a -> IO ()
- outputJSON :: JSON a => a -> IO ()
- getVar :: FromBytes a => String -> IO (Maybe a)
- setVar :: ToBytes a => String -> Maybe a -> IO ()
- getConfig :: String -> IO (Maybe String)
- setError :: String -> IO ()
- class ToBytes a where
- toBytes :: a -> ByteString
- class FromBytes a where
- fromBytes :: ByteString -> Either String a
- newtype JSONValue a = JSONValue a
- newtype MsgPackValue a = MsgPackValue a
Documentation
tryInput :: FromBytes a => IO (Either String a) Source #
Get plugin input, returning an error message if the encoding is invalid
inputByteString :: IO ByteString Source #
Get plugin input as a ByteString
inputString :: IO String Source #
Get plugin input as a String
inputJSON :: JSON a => IO (Either String a) Source #
Get input as JSON
, this is similar to calling `input (JsonValue ...)`
outputJSON :: JSON a => a -> IO () Source #
Set plugin output to a JSON encoded version of the provided value
class ToBytes a where Source #
A class used to convert values to bytes to be written into linear memory
Methods
toBytes :: a -> ByteString Source #
Instances
class FromBytes a where Source #
A class used to convert values from bytes read from linear memory
Instances
FromBytes Int32 Source # | |
Defined in Extism.PDK.Memory | |
FromBytes Int64 Source # | |
Defined in Extism.PDK.Memory | |
FromBytes Word32 Source # | |
Defined in Extism.PDK.Memory | |
FromBytes Word64 Source # | |
Defined in Extism.PDK.Memory | |
FromBytes ByteString Source # | |
Defined in Extism.PDK.Memory Methods fromBytes :: ByteString -> Either String ByteString Source # | |
FromBytes String Source # | |
Defined in Extism.PDK.Memory | |
FromBytes Double Source # | |
Defined in Extism.PDK.Memory | |
FromBytes Float Source # | |
Defined in Extism.PDK.Memory | |
JSON a => FromBytes (JSONValue a) Source # | |
Defined in Extism.PDK.Memory | |
MsgPack a => FromBytes (MsgPackValue a) Source # | |
Defined in Extism.PDK.Memory Methods fromBytes :: ByteString -> Either String (MsgPackValue a) Source # |
A wrapper type for JSON encoded values
Constructors
JSONValue a |
newtype MsgPackValue a Source #
A wrapper type for MsgPack encoded values
Constructors
MsgPackValue a |
Instances
MsgPack a => FromBytes (MsgPackValue a) Source # | |
Defined in Extism.PDK.Memory Methods fromBytes :: ByteString -> Either String (MsgPackValue a) Source # | |
MsgPack a => ToBytes (MsgPackValue a) Source # | |
Defined in Extism.PDK.Memory Methods toBytes :: MsgPackValue a -> ByteString Source # |