Skip to content
This repository has been archived by the owner on Dec 11, 2024. It is now read-only.

Commit

Permalink
Missing files
Browse files Browse the repository at this point in the history
  • Loading branch information
vigoo committed Feb 14, 2024
1 parent 7e31192 commit ebd668f
Show file tree
Hide file tree
Showing 3 changed files with 265 additions and 0 deletions.
80 changes: 80 additions & 0 deletions wasm-rpc/proto/wasm/rpc/type.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
syntax = "proto3";

package wasm.rpc;

message Type {
oneof type {
TypePrimitive primitive = 1;
TypeList list = 2;
TypeTuple tuple = 3;
TypeRecord record = 5;
TypeFlags flags = 6;
TypeEnum enum = 7;
TypeOption option = 8;
TypeResult result = 9;
TypeVariant variant = 10;
}
}

message TypePrimitive {
PrimitiveType primitive = 1;
}

message TypeList {
Type elem = 1;
}

message TypeTuple {
repeated Type elems = 1;
}

message TypeRecord {
repeated NameTypePair fields = 1;
}

message TypeFlags {
repeated string names = 1;
}

message TypeEnum {
repeated string names = 1;
}

message TypeOption {
Type elem = 1;
}

message TypeResult {
optional Type ok = 1;
optional Type err = 2;
}

message TypeVariant {
repeated NameOptionTypePair cases = 1;
}

message NameTypePair {
string name = 1;
Type typ = 2;
}

message NameOptionTypePair {
string name = 1;
optional Type typ = 2;
}

enum PrimitiveType {
BOOL = 0;
S8 = 1;
U8 = 2;
S16 = 3;
U16 = 4;
S32 = 5;
U32 = 6;
S64 = 7;
U64 = 8;
F32 = 9;
F64 = 10;
CHR = 11;
STR = 12;
}
65 changes: 65 additions & 0 deletions wasm-rpc/proto/wasm/rpc/val.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
syntax = "proto3";

package wasm.rpc;

message Val {
oneof val {
bool bool = 1;
int32 s8 = 2;
int32 u8 = 3;
int32 s16 = 4;
int32 u16 = 5;
int32 s32 = 6;
int64 u32 = 7;
int64 s64 = 8;
int64 u64 = 9;
float f32 = 10;
double f64 = 11;
int32 char = 12;
string string = 13;
ValList list = 14;
ValRecord record = 15;
ValTuple tuple = 16;
ValVariant variant = 17;
ValEnum enum = 18;
ValOption option = 20;
ValResult result = 21;
ValFlags flags = 22;
}
}

message ValList {
repeated Val values = 2;
}

message ValRecord {
repeated Val values = 2;
}

message ValTuple {
repeated Val values = 2;
}

message ValVariant {
int32 discriminant = 2;
optional Val value = 3;
}

message ValEnum {
int32 discriminant = 2;
}

message ValOption {
int32 discriminant = 2;
optional Val value = 3;
}

message ValResult {
int32 discriminant = 2;
optional Val value = 3;
}

message ValFlags {
int32 count = 2;
repeated int32 value = 3;
}
120 changes: 120 additions & 0 deletions wasm-rpc/proto/wasm/rpc/witvalue.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
syntax = "proto3";

package wasm.rpc;

message WitValue {
repeated WitNode nodes = 1;
}

message WitNode {
oneof value {
WitRecordNode record = 1;
WitVariantNode variant = 2;
WitEnumNode enum = 3;
WitFlagsNode flags = 4;
WitTupleNode tuple = 5;
WitListNode list = 6;
WitOptionNode option = 7;
WitResultNode result = 8;
WitPrimU8Node u8 = 9;
WitPrimU16Node u16 = 10;
WitPrimU32Node u32 = 11;
WitPrimU64Node u64 = 12;
WitPrimI8Node i8 = 13;
WitPrimI16Node i16 = 14;
WitPrimI32Node i32 = 15;
WitPrimI64Node i64 = 16;
WitPrimF32Node f32 = 17;
WitPrimF64Node f64 = 18;
WitPrimCharNode char = 19;
WitPrimBoolNode bool = 20;
WitPrimStringNode string = 21;
}
}

message WitRecordNode {
repeated int32 fields = 1;
}

message WitVariantNode {
uint32 case_index = 1;
optional int32 case_value = 2;
}

message WitEnumNode {
uint32 value = 1;
}

message WitFlagsNode {
repeated bool flags = 1;
}

message WitTupleNode {
repeated int32 values = 1;
}

message WitListNode {
repeated int32 values = 1;
}

message WitOptionNode {
optional int32 value = 1;
}

message WitResultNode {
int32 discriminant = 1;
optional int32 value = 2;
}

message WitPrimU8Node {
uint32 value = 1;
}

message WitPrimU16Node {
uint32 value = 1;
}

message WitPrimU32Node {
uint32 value = 1;
}

message WitPrimU64Node {
uint64 value = 1;
}

message WitPrimI8Node {
sint32 value = 1;
}

message WitPrimI16Node {
sint32 value = 1;
}

message WitPrimI32Node {
sint32 value = 1;
}

message WitPrimI64Node {
sint64 value = 1;
}

message WitPrimF32Node {
float value = 1;
}

message WitPrimF64Node {
double value = 1;
}

message WitPrimCharNode {
uint32 value = 1;
}

message WitPrimBoolNode {
bool value = 1;
}

message WitPrimStringNode {
string value = 1;
}

0 comments on commit ebd668f

Please sign in to comment.