wry_bindgen_runtime/
lib.rs1#![doc = include_str!("../README.md")]
2#![no_std]
3
4extern crate alloc;
5#[macro_use]
6extern crate std;
7
8mod batch;
9mod function_registry;
10mod id_allocator;
11mod ipc;
12mod js_helpers;
13mod runtime;
14mod type_cache;
15mod wry;
16
17#[doc(hidden)]
27pub mod wire;
28
29pub use wry::{
30 ProtocolHandler, WryBindgen, WryBindgenDriver, WryBindgenRuntime, WryBindgenWebviewDriver,
31};
32
33mod encode {
34 pub(crate) use crate::wire::BinaryDecode;
35}
36
37mod function {
38 pub(crate) const DROP_NATIVE_REF_FN_ID: u32 = 0xFFFF_FFFF;
39 pub(crate) const CALL_EXPORT_FN_ID: u32 = 0xFFFF_FFFE;
40 pub(crate) use crate::wire::RustCallback;
41}
42
43mod object_store {
44 use alloc::boxed::Box;
45 use core::any::Any;
46
47 pub(crate) use crate::wire::ObjectHandle;
48
49 pub(crate) fn drop_object(handle: ObjectHandle) -> bool {
50 let object: Option<Box<dyn Any>> =
51 crate::batch::with_runtime(|state| state.remove_object_untyped(handle));
52 let dropped = object.is_some();
53 drop(object);
54 dropped
55 }
56}
57
58mod value {
59 pub(crate) const JSIDX_OFFSET: u64 = 128;
60 pub(crate) const JSIDX_RESERVED: u64 = JSIDX_OFFSET + 4;
61}