#![allow(clippy::missing_safety_doc)]
#![allow(non_camel_case_types)]
use cxx::{ExternType, type_id};
#[cxx::bridge]
pub(crate) mod ffi {
unsafe extern "C++" {
include!("executorch-sys/cpp/executorch_rs/cxx_bridge.hpp");
type ET_MemoryAllocator = crate::ET_MemoryAllocator;
#[namespace = "executorch_rs"]
fn BufferMemoryAllocator_into_memory_allocator_unique_ptr(
self_: Pin<&mut ET_MemoryAllocator>,
) -> UniquePtr<ET_MemoryAllocator>;
#[namespace = "executorch::extension"]
type MallocMemoryAllocator;
#[namespace = "executorch_rs"]
fn MallocMemoryAllocator_new() -> UniquePtr<MallocMemoryAllocator>;
#[namespace = "executorch_rs"]
unsafe fn MallocMemoryAllocator_as_memory_allocator(
self_: Pin<&mut MallocMemoryAllocator>,
) -> *mut ET_MemoryAllocator;
#[namespace = "executorch_rs"]
fn MallocMemoryAllocator_into_memory_allocator_unique_ptr(
self_: UniquePtr<MallocMemoryAllocator>,
) -> UniquePtr<ET_MemoryAllocator>;
}
impl UniquePtr<ET_MemoryAllocator> {}
}
unsafe impl ExternType for crate::ET_ScalarType {
type Id = type_id!("ET_ScalarType");
type Kind = cxx::kind::Trivial;
}
unsafe impl ExternType for crate::ET_TensorShapeDynamism {
type Id = type_id!("ET_TensorShapeDynamism");
type Kind = cxx::kind::Trivial;
}
unsafe impl ExternType for crate::ET_Error {
type Id = type_id!("ET_Error");
type Kind = cxx::kind::Trivial;
}
unsafe impl ExternType for crate::ET_MethodMeta {
type Id = type_id!("ET_MethodMeta");
type Kind = cxx::kind::Trivial;
}
unsafe impl ExternType for crate::ET_ArrayRefEValue {
type Id = type_id!("ET_ArrayRefEValue");
type Kind = cxx::kind::Trivial;
}
unsafe impl ExternType for crate::ET_VecEValue {
type Id = type_id!("ET_VecEValue");
type Kind = cxx::kind::Trivial;
}
unsafe impl ExternType for crate::ET_ProgramVerification {
type Id = type_id!("ET_ProgramVerification");
type Kind = cxx::kind::Trivial;
}
unsafe impl ExternType for crate::ET_MemoryAllocator {
type Id = type_id!("ET_MemoryAllocator");
type Kind = cxx::kind::Opaque;
}
unsafe impl ExternType for crate::ET_Device {
type Id = type_id!("ET_Device");
type Kind = cxx::kind::Trivial;
}