summaryrefslogtreecommitdiffstats
path: root/third_party/rust/uniffi_bindgen/src/bindings/python/templates/wrapper.py
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/rust/uniffi_bindgen/src/bindings/python/templates/wrapper.py')
-rw-r--r--third_party/rust/uniffi_bindgen/src/bindings/python/templates/wrapper.py17
1 files changed, 13 insertions, 4 deletions
diff --git a/third_party/rust/uniffi_bindgen/src/bindings/python/templates/wrapper.py b/third_party/rust/uniffi_bindgen/src/bindings/python/templates/wrapper.py
index 24c3290ff7..1ccd6821c0 100644
--- a/third_party/rust/uniffi_bindgen/src/bindings/python/templates/wrapper.py
+++ b/third_party/rust/uniffi_bindgen/src/bindings/python/templates/wrapper.py
@@ -1,3 +1,5 @@
+{%- call py::docstring_value(ci.namespace_docstring(), 0) %}
+
# This file was autogenerated by some hot garbage in the `uniffi` crate.
# Trust me, you don't want to mess with it!
@@ -13,6 +15,7 @@
# compile the rust component. The easiest way to ensure this is to bundle the Python
# helpers directly inline like we're doing here.
+from __future__ import annotations
import os
import sys
import ctypes
@@ -20,6 +23,9 @@ import enum
import struct
import contextlib
import datetime
+import threading
+import itertools
+import traceback
import typing
{%- if ci.has_async_fns() %}
import asyncio
@@ -34,20 +40,20 @@ _DEFAULT = object()
{% include "RustBufferTemplate.py" %}
{% include "Helpers.py" %}
-{% include "PointerManager.py" %}
+{% include "HandleMap.py" %}
{% include "RustBufferHelper.py" %}
# Contains loading, initialization code, and the FFI Function declarations.
{% include "NamespaceLibraryTemplate.py" %}
+# Public interface members begin here.
+{{ type_helper_code }}
+
# Async support
{%- if ci.has_async_fns() %}
{%- include "Async.py" %}
{%- endif %}
-# Public interface members begin here.
-{{ type_helper_code }}
-
{%- for func in ci.function_definitions() %}
{%- include "TopLevelFunctionTemplate.py" %}
{%- endfor %}
@@ -69,6 +75,9 @@ __all__ = [
{%- for c in ci.callback_interface_definitions() %}
"{{ c.name()|class_name }}",
{%- endfor %}
+ {%- if ci.has_async_fns() %}
+ "uniffi_set_event_loop",
+ {%- endif %}
]
{% import "macros.py" as py %}