MCPcopy Create free account
hub / github.com/apache/tvm-ffi / ObjectCore

Interface ObjectCore

rust/tvm-ffi/src/object.rs:50–65  ·  view source on GitHub ↗

Traits that can be used to check if a type is an object This trait is unsafe because it is used to access the object header and the object header is unsafe to access

Source from the content-addressed store, hash-verified

48/// This trait is unsafe because it is used to access the object header
49/// and the object header is unsafe to access
50pub unsafe trait ObjectCore: Sized + 'static {
51 /// the type key of the object
52 const TYPE_KEY: &'static str;
53 // return the type index of the object
54 fn type_index() -> i32;
55 /// Return the object header
56 /// This function is implemented as a static function so
57 ///
58 /// # Arguments
59 /// * `this` - The object to get the header
60 ///
61 /// # Returns
62 /// * `&mut TVMFFIObject` - The object header
63 /// \return The object header
64 unsafe fn object_header_mut(this: &mut Self) -> &mut TVMFFIObject;
65}
66
67/// Traits for objects with extra items that follows the object
68///

Callers

nothing calls this directly

Implementers 4

object.rsrust/tvm-ffi/src/object.rs
function.rsrust/tvm-ffi/src/function.rs
tensor.rsrust/tvm-ffi/src/collections/tensor.rs
test_object.rsrust/tvm-ffi/tests/test_object.rs

Calls

no outgoing calls

Tested by

no test coverage detected