MCPcopy Create free account
hub / github.com/CommE2E/comm / getRustAPI

Function getRustAPI

keyserver/addons/rust-node-addon/index.js:22–53  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

20}
21
22async function getRustAPI(): Promise<RustNativeBindingAPI> {
23 let nativeBinding = null;
24 if (platform === 'darwin' && arch === 'x64') {
25 // $FlowFixMe
26 nativeBinding = nativeBindingRequire(
27 './napi/rust-node-addon.darwin-x64.node',
28 );
29 } else if (platform === 'darwin' && arch === 'arm64') {
30 // $FlowFixMe
31 nativeBinding = nativeBindingRequire(
32 './napi/rust-node-addon.darwin-arm64.node',
33 );
34 } else if (platform === 'linux' && arch === 'x64') {
35 // $FlowFixMe
36 nativeBinding = nativeBindingRequire(
37 './napi/rust-node-addon.linux-x64-gnu.node',
38 );
39 } else if (platform === 'linux' && arch === 'arm64') {
40 // $FlowFixMe
41 nativeBinding = nativeBindingRequire(
42 './napi/rust-node-addon.linux-arm64-gnu.node',
43 );
44 } else {
45 throw new Error(`Unsupported OS: ${platform}, architecture: ${arch}`);
46 }
47
48 if (!nativeBinding) {
49 throw new Error('Failed to load Rust native binding');
50 }
51
52 return nativeBinding;
53}
54
55export { getRustAPI };

Callers 12

getVerifiedUserIDForFIDFunction · 0.90
findUserIdentitiesFunction · 0.90
privilegedDeleteUsersFunction · 0.90
syncPlatformDetailsFunction · 0.90
uploadOneTimeKeysFunction · 0.90
publishPrekeysFunction · 0.90
registerOrLogInBaseFunction · 0.90
tunnelbroker.jsFile · 0.90
deleteAccountFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected