// Generated by `wit-bindgen` 0.41.0. DO NOT EDIT! // Options used: // * runtime_path: "wit_bindgen_rt" #[rustfmt::skip] #[allow(dead_code, clippy::all)] pub mod exports { pub mod ringlet { pub mod pwc315_t1_find_words { #[allow(dead_code, async_fn_in_trait, unused_imports, clippy::all)] pub mod find_words { #[used] #[doc(hidden)] static __FORCE_SECTION_REF: fn() = super::super::super::super::__link_custom_section_describing_imports; use super::super::super::super::_rt; #[doc(hidden)] #[allow(non_snake_case)] pub unsafe fn _export_find_words_cabi( arg0: *mut u8, arg1: usize, arg2: i32, ) -> *mut u8 { #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); let base3 = arg0; let len3 = arg1; let mut result3 = _rt::Vec::with_capacity(len3); for i in 0..len3 { let base = base3 .add(i * (2 * ::core::mem::size_of::<*const u8>())); let e3 = { let l0 = *base.add(0).cast::<*mut u8>(); let l1 = *base .add(::core::mem::size_of::<*const u8>()) .cast::(); let len2 = l1; let bytes2 = _rt::Vec::from_raw_parts(l0.cast(), len2, len2); _rt::string_lift(bytes2) }; result3.push(e3); } _rt::cabi_dealloc( base3, len3 * (2 * ::core::mem::size_of::<*const u8>()), ::core::mem::size_of::<*const u8>(), ); let result4 = T::find_words(result3, _rt::char_lift(arg2 as u32)); let ptr5 = (&raw mut _RET_AREA.0).cast::(); let vec6 = (result4).into_boxed_slice(); let ptr6 = vec6.as_ptr().cast::(); let len6 = vec6.len(); ::core::mem::forget(vec6); *ptr5.add(::core::mem::size_of::<*const u8>()).cast::() = len6; *ptr5.add(0).cast::<*mut u8>() = ptr6.cast_mut(); ptr5 } #[doc(hidden)] #[allow(non_snake_case)] pub unsafe fn __post_return_find_words(arg0: *mut u8) { let l0 = *arg0.add(0).cast::<*mut u8>(); let l1 = *arg0 .add(::core::mem::size_of::<*const u8>()) .cast::(); let base2 = l0; let len2 = l1; _rt::cabi_dealloc(base2, len2 * 4, 4); } pub trait Guest { fn find_words( wlist: _rt::Vec<_rt::String>, wchar: char, ) -> _rt::Vec; } #[doc(hidden)] macro_rules! __export_ringlet_pwc315_t1_find_words_find_words_0_1_0_cabi { ($ty:ident with_types_in $($path_to_types:tt)*) => { const _ : () = { #[unsafe (export_name = "ringlet:pwc315-t1-find-words/find-words@0.1.0#find-words")] unsafe extern "C" fn export_find_words(arg0 : * mut u8, arg1 : usize, arg2 : i32,) -> * mut u8 { unsafe { $($path_to_types)*:: _export_find_words_cabi::<$ty > (arg0, arg1, arg2) } } #[unsafe (export_name = "cabi_post_ringlet:pwc315-t1-find-words/find-words@0.1.0#find-words")] unsafe extern "C" fn _post_return_find_words(arg0 : * mut u8,) { unsafe { $($path_to_types)*:: __post_return_find_words::<$ty > (arg0) } } }; }; } #[doc(hidden)] pub(crate) use __export_ringlet_pwc315_t1_find_words_find_words_0_1_0_cabi; #[cfg_attr(target_pointer_width = "64", repr(align(8)))] #[cfg_attr(target_pointer_width = "32", repr(align(4)))] struct _RetArea( [::core::mem::MaybeUninit< u8, >; 2 * ::core::mem::size_of::<*const u8>()], ); static mut _RET_AREA: _RetArea = _RetArea( [::core::mem::MaybeUninit::uninit(); 2 * ::core::mem::size_of::<*const u8>()], ); } } } } #[rustfmt::skip] mod _rt { #![allow(dead_code, clippy::all)] #[cfg(target_arch = "wasm32")] pub fn run_ctors_once() { wit_bindgen_rt::run_ctors_once(); } pub use alloc_crate::vec::Vec; pub unsafe fn string_lift(bytes: Vec) -> String { if cfg!(debug_assertions) { String::from_utf8(bytes).unwrap() } else { String::from_utf8_unchecked(bytes) } } pub unsafe fn cabi_dealloc(ptr: *mut u8, size: usize, align: usize) { if size == 0 { return; } let layout = alloc::Layout::from_size_align_unchecked(size, align); alloc::dealloc(ptr, layout); } pub unsafe fn char_lift(val: u32) -> char { if cfg!(debug_assertions) { core::char::from_u32(val).unwrap() } else { core::char::from_u32_unchecked(val) } } pub use alloc_crate::string::String; extern crate alloc as alloc_crate; pub use alloc_crate::alloc; } /// Generates `#[unsafe(no_mangle)]` functions to export the specified type as /// the root implementation of all generated traits. /// /// For more information see the documentation of `wit_bindgen::generate!`. /// /// ```rust /// # macro_rules! export{ ($($t:tt)*) => (); } /// # trait Guest {} /// struct MyType; /// /// impl Guest for MyType { /// // ... /// } /// /// export!(MyType); /// ``` #[allow(unused_macros)] #[doc(hidden)] macro_rules! __export_pwc315_t1_find_words_impl { ($ty:ident) => { self::export!($ty with_types_in self); }; ($ty:ident with_types_in $($path_to_types_root:tt)*) => { $($path_to_types_root)*:: exports::ringlet::pwc315_t1_find_words::find_words::__export_ringlet_pwc315_t1_find_words_find_words_0_1_0_cabi!($ty with_types_in $($path_to_types_root)*:: exports::ringlet::pwc315_t1_find_words::find_words); }; } #[doc(inline)] pub(crate) use __export_pwc315_t1_find_words_impl as export; #[cfg(target_arch = "wasm32")] #[unsafe( link_section = "component-type:wit-bindgen:0.41.0:ringlet:pwc315-t1-find-words@0.1.0:pwc315-t1-find-words:encoded world" )] #[doc(hidden)] #[allow(clippy::octal_escapes)] pub static __WIT_BINDGEN_COMPONENT_TYPE: [u8; 298] = *b"\ \0asm\x0d\0\x01\0\0\x19\x16wit-component-encoding\x04\0\x07\x9f\x01\x01A\x02\x01\ A\x02\x01B\x04\x01ps\x01py\x01@\x02\x05wlist\0\x05wchart\0\x01\x04\0\x0afind-wor\ ds\x01\x02\x04\0-ringlet:pwc315-t1-find-words/find-words@0.1.0\x05\0\x04\07ringl\ et:pwc315-t1-find-words/pwc315-t1-find-words@0.1.0\x04\0\x0b\x1a\x01\0\x14pwc315\ -t1-find-words\x03\0\0\0G\x09producers\x01\x0cprocessed-by\x02\x0dwit-component\x07\ 0.227.1\x10wit-bindgen-rust\x060.41.0"; #[inline(never)] #[doc(hidden)] pub fn __link_custom_section_describing_imports() { wit_bindgen_rt::maybe_link_cabi_realloc(); }