#[cfg(target_arch = "wasm32")] // defines `extern "C" diplomat_init()` mod wasm_glue;
mod writeable; pubuse writeable::DiplomatWriteable;
mod result; pubuse result::DiplomatResult;
/// Like [`char`], but unvalidated. pubtype DiplomatChar = u32;
/// Like [`str`], but unvalidated. pubtype DiplomatStr = [u8];
/// Like `Wstr`, but unvalidated. pubtype DiplomatStr16 = [u16];
/// Like [`u8`], but interpreted explicitly as a raw byte as opposed to a numerical value. /// This matters for languages like JavaScript or Dart, where there's only a single numeric /// type, but special types for byte buffers. pubtype DiplomatByte = u8;
/// Allocates a buffer of a given size in Rust's memory. /// /// # Safety /// - The allocated buffer must be freed with [`diplomat_free()`]. #[no_mangle] pubunsafeextern"C"fn diplomat_alloc(size: usize, align: usize) -> *mut u8 {
alloc::alloc::alloc(Layout::from_size_align(size, align).unwrap())
}
/// Frees a buffer that was allocated in Rust's memory. /// # Safety /// - `ptr` must be a pointer to a valid buffer allocated by [`diplomat_alloc()`]. #[no_mangle] pubunsafeextern"C"fn diplomat_free(ptr: *mut u8, size: usize, align: usize) {
alloc::alloc::dealloc(ptr, Layout::from_size_align(size, align).unwrap())
}
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.12 Sekunden
(vorverarbeitet am 2026-06-18)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.