Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- data Memory = Memory MemoryOffset MemoryLength
- newtype JSONValue a = JSONValue a
- newtype MsgPackValue a = MsgPackValue a
- class FromBytes a where
- fromBytes :: ByteString -> a
- class ToBytes a where
- toBytes :: a -> ByteString
- data LogLevel
- free :: Memory -> IO ()
- log :: LogLevel -> String -> IO ()
- fromByteString :: ByteString -> String
- toByteString :: String -> ByteString
- input :: FromBytes a => IO a
- inputMemory :: IO Memory
- inputJSON :: JSON a => IO (Maybe a)
- load :: FromBytes a => Memory -> IO a
- store :: ToBytes a => Memory -> a -> IO ()
- outputMemory :: Memory -> IO ()
- output :: ToBytes a => a -> IO ()
- outputJSON :: JSON a => a -> IO ()
- loadString :: Memory -> IO String
- storeString :: Memory -> String -> IO ()
- alloc :: Int -> IO Memory
- allocByteString :: ByteString -> IO Memory
- allocString :: String -> IO Memory
- memoryOffset :: Memory -> MemoryOffset
- memoryLength :: Memory -> MemoryLength
- findMemory :: MemoryOffset -> IO Memory
- getVar :: String -> IO (Maybe ByteString)
- setVar :: ToBytes a => String -> Maybe a -> IO ()
- getConfig :: String -> IO (Maybe String)
- setError :: String -> IO ()
- toString :: JSON a => a -> String
Documentation
newtype MsgPackValue a Source #
Instances
MsgPack a => FromBytes (MsgPackValue a) Source # | |
Defined in Extism.PDK fromBytes :: ByteString -> MsgPackValue a Source # | |
MsgPack a => ToBytes (MsgPackValue a) Source # | |
Defined in Extism.PDK toBytes :: MsgPackValue a -> ByteString Source # |
class FromBytes a where Source #
fromBytes :: ByteString -> a Source #
Instances
FromBytes ByteString Source # | |
Defined in Extism.PDK fromBytes :: ByteString -> ByteString Source # | |
FromBytes String Source # | |
Defined in Extism.PDK fromBytes :: ByteString -> String Source # | |
JSON a => FromBytes (JSONValue a) Source # | |
Defined in Extism.PDK fromBytes :: ByteString -> JSONValue a Source # | |
MsgPack a => FromBytes (MsgPackValue a) Source # | |
Defined in Extism.PDK fromBytes :: ByteString -> MsgPackValue a Source # |
class ToBytes a where Source #
toBytes :: a -> ByteString Source #
Instances
ToBytes ByteString Source # | |
Defined in Extism.PDK toBytes :: ByteString -> ByteString Source # | |
ToBytes String Source # | |
Defined in Extism.PDK toBytes :: String -> ByteString Source # | |
JSON a => ToBytes (JSONValue a) Source # | |
Defined in Extism.PDK toBytes :: JSONValue a -> ByteString Source # | |
MsgPack a => ToBytes (MsgPackValue a) Source # | |
Defined in Extism.PDK toBytes :: MsgPackValue a -> ByteString Source # |
fromByteString :: ByteString -> String Source #
Helper function to convert a bytestring to a string
toByteString :: String -> ByteString Source #
Helper function to convert a string to a bytestring
outputJSON :: JSON a => a -> IO () Source #
Set plugin output to a JSON encoded version of the provided value
allocByteString :: ByteString -> IO Memory Source #
Allocate a new Memory
block and copy the contents of the provided ByteString
memoryOffset :: Memory -> MemoryOffset Source #
Get the offset of a Memory
block
memoryLength :: Memory -> MemoryLength Source #
Get the length of a Memory
block
findMemory :: MemoryOffset -> IO Memory Source #
Find Memory
block by offset