fork/rust-sdks

git clone https://git.julia.blue/fork/rust-sdks

Ben CherryRPC implementation + FFI (#461)2aa9500

livekit/livekit-ffi@0.13.0
2.1 KiB81 linesraw
1// Copyright 2023 LiveKit, Inc.
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15syntax = "proto2";
16
17package livekit.proto;
18option csharp_namespace = "LiveKit.Proto";
19
20message RpcError {
21  required uint32 code = 1;
22  required string message = 2;
23  optional string data = 3;
24}
25
26// FFI Requests
27message PerformRpcRequest {
28  required uint64 local_participant_handle = 1;
29  required string destination_identity = 2;
30  required string method = 3;
31  required string payload = 4;
32  optional uint32 response_timeout_ms = 5;
33}
34
35message RegisterRpcMethodRequest {
36  required uint64 local_participant_handle = 1;
37  required string method = 2;
38}
39
40message UnregisterRpcMethodRequest {
41  required uint64 local_participant_handle = 1;
42  required string method = 2;
43}
44
45message RpcMethodInvocationResponseRequest {
46  required uint64 local_participant_handle = 1;
47  required uint64 invocation_id = 2;
48  optional string payload = 3;
49  optional RpcError error = 4;
50}
51
52// FFI Responses
53message PerformRpcResponse {
54  required uint64 async_id = 1;
55}
56
57message RegisterRpcMethodResponse {}
58
59message UnregisterRpcMethodResponse {}
60
61message RpcMethodInvocationResponseResponse {
62  optional string error = 1;
63}
64
65// FFI Callbacks
66message PerformRpcCallback {
67  required uint64 async_id = 1;
68  optional string payload = 2;
69  optional RpcError error = 3;
70}
71
72// FFI Events
73message RpcMethodInvocationEvent {
74  required uint64 local_participant_handle = 1;
75  required uint64 invocation_id = 2;
76  required string method = 3;
77  required string request_id = 4;
78  required string caller_identity = 5;
79  required string payload = 6;
80  required uint32 response_timeout_ms = 7;
81}