wrpc 0.16.0

WebAssembly component-native RPC framework based on WIT
Documentation
package wrpc-test:integration;

interface sync {
    flags abc {
        a,
        b,
        c,
    }

    record rec-nested {
        foo: string,
    }

    record rec {
        nested: rec-nested,
    }

    variant var {
        var(rec),
        empty,
    }

    enum foobar {
        foo,
        bar,
    }

    fallible: func(ok: bool) -> result<bool, string>;
    numbers: func() -> tuple<u8, u16, u32, u64, s8, s16, s32, s64, f32, f64>;
    with-flags: func(a: bool, b: bool, c: bool) -> abc;
    with-variant-option: func(ok: bool) -> option<var>;
    with-variant-list: func() -> list<var>;
    with-record: func() -> rec;
    with-record-list: func(n: u8) -> list<rec>;
    with-record-tuple: func() -> tuple<rec, rec>;
    with-enum: func() -> foobar;
}

interface async {
    record something {
        foo: string,
    }

    with-streams: func() -> tuple<stream<u8>, stream<list<string>>>;
    with-future: func(x: something, s: stream<u8>) -> future<stream<u8>>;
    identity-nested-async: func(v: future<future<future<stream<string>>>>) -> future<future<future<stream<string>>>>;
}

interface resources {
    resource foo {
        constructor();
        foo: static func(v: foo) -> string;
        bar: func() -> string;
    }

    bar: func(v: borrow<foo>) -> string;
}

world sync-server {
    export sync;

    export foo: interface {
        f: func(x: string) -> u32;
        foo: func(x: string);
    }
}

world sync-client {
    import sync;

    import foo: interface {
        f: func(x: string) -> u32;
        foo: func(x: string);
    }
}

world async-server {
    export async;
}

world async-client {
    import async;
}

world resources-server {
    export resources;

    export strange: interface {
        use resources.{foo};

        bar: func(v: borrow<foo>) -> u64;
    }
}

world resources-client {
    import resources;

    import strange: interface {
        use resources.{foo};

        bar: func(v: borrow<foo>) -> u64;
    }
}

interface get-types {
    flags feature-flags {
        show-a,
        show-b,
        show-c,
        show-d,
        show-e,
        show-f,
    }

    get-features: func() -> feature-flags;
}

world types {
    import get-types;
}