Types
type error
string
type nested-value
Values nested within an aggregate type. Since WIT types are not allowed to depend on themselves, nested values are stored as encoded RESP.
list<u8>
variant value
string:stringerror:stringinteger:s64bulk-string:stringarray:list<nested-value>nullboolean:booldouble:f64big-number:stringbulk-error:stringverbatim-string:tuple<string, string>map:list<tuple<nested-value, nested-value>>set:list<nested-value>push:list<nested-value>
Functions
WIT
interface resp {
type error = string;
/// Values nested within an aggregate type. Since WIT types are not allowed to depend on
/// themselves, nested values are stored as encoded RESP.
type nested-value = list<u8>;
variant value {
%string(string),
error(string),
integer(s64),
bulk-string(string),
array(list<nested-value>),
null,
boolean(bool),
double(f64),
big-number(string),
bulk-error(string),
verbatim-string(tuple<string, string>),
%map(list<tuple<nested-value, nested-value>>),
set(list<nested-value>),
push(list<nested-value>),
}
decode: func(data: list<u8>) -> result<value, error>;
encode: func(value: value) -> result<list<u8>, error>;
}