wasmVision Platform API
This is the WebAssembly guest module interface for host functions provided by the wasmVision runtime.
- Imports:
- interface
wasmvision:platform/time
- interface
wasmvision:platform/logging
- interface
wasmvision:platform/config
- interface
wasmvision:platform/http
- interface
wasmvision:platform/datastore
- interface
Import interface wasmvision:platform/time
Functions
now: func
Get the current time in milliseconds since the Unix epoch. Use 0 for the tz
parameter for now.
Params
Return values
Import interface wasmvision:platform/logging
Functions
log: func
DEPRECATED: Log a message on the host. Instead use error, warn, info, or debug.
Params
error: func
Log an error on the host.
Params
warn: func
Log a warning on the host.
Params
info: func
Log some non-critical information on the host.
Params
debug: func
Log some debugging info on the host.
Params
println: func
Print a message on the host. Intended to bypassing the normal logging system.
Params
Import interface wasmvision:platform/config
Types
enum config-error
Enum Cases
Functions
get-config: func
Params
Return values
- result<
string
,config-error
>
Import interface wasmvision:platform/http
Types
enum http-error
HTTP errors returned by the runtime.
Enum Cases
Functions
get: func
Get the content at the specified URL. Returns either the content or an error.
Params
Return values
- result<
string
,http-error
>
post: func
Post the content to the specified URL. Returns either the response content or an error.
Params
Return values
- result<
string
,http-error
>
post-image: func
Post the image to the specified URL. Template is the template to use to send the image. If the content-type is image/jpeg or image/png, the template is ignored, and the image is simply converted and sent in that format. Otherwise, the template is used to convert the image to the desired format using simple substitution of the symbol %IMAGE% after base64 encoding the image. The response-item is the item in the response to return. Usually this will be a JSON element that will be parsed. Mat is the reference to to the Mat to use.
Params
Return values
- result<
string
,http-error
>
Import interface wasmvision:platform/datastore
Types
enum datastore-error
datastore errors returned by the runtime.
Enum Cases
resource frame-store
frame-store is the interface for storing data associated with a specific frame.
resource processor-store
processor-store is the interface for storing data associated with a processor.
Functions
[constructor]frame-store: func
The id param is currently ignored
Params
Return values
- own<
frame-store
>
[method]frame-store.get: func
Get the value associated with the specified key
for the specific frame.
Returns ok(none)
if the key does not exist.
Params
self
: borrow<frame-store
>frame
:u32
key
:string
Return values
- result<
string
,datastore-error
>
[method]frame-store.set: func
Set the value
associated with the specified key
for the specific frame
overwriting any existing value.
Params
self
: borrow<frame-store
>frame
:u32
key
:string
value
:string
Return values
- result<_,
datastore-error
>
[method]frame-store.delete: func
Delete the data with the specified key
for the specified frame
No error is raised if a tuple did not previously exist for key
.
Params
self
: borrow<frame-store
>frame
:u32
key
:string
Return values
- result<_,
datastore-error
>
[method]frame-store.delete-all: func
Delete all data for the specified frame
.
No error is raised if no data exists for the frame
.
Params
self
: borrow<frame-store
>frame
:u32
Return values
- result<_,
datastore-error
>
[method]frame-store.exists: func
Return whether data exists for the specified frame
Params
self
: borrow<frame-store
>frame
:u32
Return values
- result<
bool
,datastore-error
>
[method]frame-store.get-keys: func
Return a list of all the keys. returns empty list if no keys are present.
Params
self
: borrow<frame-store
>frame
:u32
Return values
[constructor]processor-store: func
The id param is currently ignored
Params
Return values
- own<
processor-store
>
[method]processor-store.get: func
Get the value associated with the specified key
Returns ok(none)
if the key does not exist.
Params
self
: borrow<processor-store
>processor
:string
key
:string
Return values
- result<
string
,datastore-error
>
[method]processor-store.set: func
Set the value
associated with the specified key
overwriting any existing value.
Params
self
: borrow<processor-store
>processor
:string
key
:string
value
:string
Return values
- result<_,
datastore-error
>
[method]processor-store.delete: func
Delete the tuple with the specified key
No error is raised if a tuple did not previously exist for key
.
Params
self
: borrow<processor-store
>processor
:string
key
:string
Return values
- result<_,
datastore-error
>
[method]processor-store.delete-all: func
Delete all the data for the specified processor
.
No error is raised if no data exists for the processor
.
Params
self
: borrow<processor-store
>processor
:string
Return values
- result<_,
datastore-error
>
[method]processor-store.exists: func
Return whether data exists for the specified processor
.
Params
self
: borrow<processor-store
>processor
:string
Return values
- result<
bool
,datastore-error
>
[method]processor-store.get-keys: func
Return a list of all the keys. returns empty list if no keys are present.
Params
self
: borrow<processor-store
>processor
:string