tvm_ffi/reflection.rs
1/*
2 * Licensed to the Apache Software Foundation (ASF) under one
3 * or more contributor license agreements. See the NOTICE file
4 * distributed with this work for additional information
5 * regarding copyright ownership. The ASF licenses this file
6 * to you under the Apache License, Version 2.0 (the
7 * "License"); you may not use this file except in compliance
8 * with the License. You may obtain a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing,
13 * software distributed under the License is distributed on an
14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 * KIND, either express or implied. See the License for the
16 * specific language governing permissions and limitations
17 * under the License.
18 */
19
20//! Object reflection: look up the methods, fields and type attributes of
21//! registered types; register Rust object types with [`ObjectDef`], type
22//! attributes with [`TypeAttrDef`] and enum values with [`EnumDef`]; call the
23//! typed hooks that attributes hold with [`NativeFunction`].
24
25mod access_path;
26mod accessor;
27pub(crate) mod enum_def;
28mod native_function;
29mod registry;
30mod unsafe_init;
31pub use access_path::{AccessKind, AccessPath, AccessPathObj, AccessStep, AccessStepObj};
32pub use accessor::{
33 FieldGetter, TypeAttrColumn, field_default, get_method, get_method_by_index, type_key,
34};
35pub use enum_def::{EnumAttrMap, EnumDef};
36pub use native_function::{NativeArgs, NativeFunction};
37pub(crate) use registry::field_static_type_index;
38#[doc(hidden)]
39pub use registry::register_object;
40pub use registry::{FieldFlags, ObjectDef, SEqHashKind, ShallowCopy, TypeAttrDef};
41pub use unsafe_init::{UnsafeInit, unsafe_init};
42#[doc(hidden)]
43pub use unsafe_init::{field_drop, unsafe_init_creator};