// 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 pwc317_t1_acronyms { #[allow(dead_code, async_fn_in_trait, unused_imports, clippy::all)] pub mod acronyms { #[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_acronyms_cabi( arg0: *mut u8, arg1: usize, arg2: *mut u8, arg3: usize, ) -> i32 { #[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 len4 = arg3; let bytes4 = _rt::Vec::from_raw_parts(arg2.cast(), len4, len4); let result5 = T::acronyms(result3, _rt::string_lift(bytes4)); match result5 { true => 1, false => 0, } } pub trait Guest { fn acronyms(wlist: _rt::Vec<_rt::String>, word: _rt::String) -> bool; } #[doc(hidden)] macro_rules! __export_ringlet_pwc317_t1_acronyms_acronyms_0_1_0_cabi { ($ty:ident with_types_in $($path_to_types:tt)*) => { const _ : () = { #[unsafe (export_name = "ringlet:pwc317-t1-acronyms/acronyms@0.1.0#acronyms")] unsafe extern "C" fn export_acronyms(arg0 : * mut u8, arg1 : usize, arg2 : * mut u8, arg3 : usize,) -> i32 { unsafe { $($path_to_types)*:: _export_acronyms_cabi::<$ty > (arg0, arg1, arg2, arg3) } } }; }; } #[doc(hidden)] pub(crate) use __export_ringlet_pwc317_t1_acronyms_acronyms_0_1_0_cabi; } } } } #[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 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_pwc317_t1_acronyms_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::pwc317_t1_acronyms::acronyms::__export_ringlet_pwc317_t1_acronyms_acronyms_0_1_0_cabi!($ty with_types_in $($path_to_types_root)*:: exports::ringlet::pwc317_t1_acronyms::acronyms); }; } #[doc(inline)] pub(crate) use __export_pwc317_t1_acronyms_impl as export; #[cfg(target_arch = "wasm32")] #[unsafe( link_section = "component-type:wit-bindgen:0.41.0:ringlet:pwc317-t1-acronyms@0.1.0:pwc317-t1-acronyms:encoded world" )] #[doc(hidden)] #[allow(clippy::octal_escapes)] pub static __WIT_BINDGEN_COMPONENT_TYPE: [u8; 282] = *b"\ \0asm\x0d\0\x01\0\0\x19\x16wit-component-encoding\x04\0\x07\x91\x01\x01A\x02\x01\ A\x02\x01B\x03\x01ps\x01@\x02\x05wlist\0\x04words\0\x7f\x04\0\x08acronyms\x01\x01\ \x04\0)ringlet:pwc317-t1-acronyms/acronyms@0.1.0\x05\0\x04\03ringlet:pwc317-t1-a\ cronyms/pwc317-t1-acronyms@0.1.0\x04\0\x0b\x18\x01\0\x12pwc317-t1-acronyms\x03\0\ \0\0G\x09producers\x01\x0cprocessed-by\x02\x0dwit-component\x070.227.1\x10wit-bi\ ndgen-rust\x060.41.0"; #[inline(never)] #[doc(hidden)] pub fn __link_custom_section_describing_imports() { wit_bindgen_rt::maybe_link_cabi_realloc(); }