From 8cdfa445d6629ffef4cb84967ff7017654045bc2 Mon Sep 17 00:00:00 2001 From: mo khan Date: Wed, 2 Jul 2025 18:36:06 -0600 Subject: chore: add vendor directory --- vendor/windows-core/src/param_value.rs | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 vendor/windows-core/src/param_value.rs (limited to 'vendor/windows-core/src/param_value.rs') diff --git a/vendor/windows-core/src/param_value.rs b/vendor/windows-core/src/param_value.rs new file mode 100644 index 00000000..4500e261 --- /dev/null +++ b/vendor/windows-core/src/param_value.rs @@ -0,0 +1,24 @@ +use super::*; +use core::mem::transmute_copy; + +#[doc(hidden)] +pub enum ParamValue> { + Owned(T), + Borrowed(T::Abi), +} + +impl> ParamValue { + // TODO: replace with `borrow` in windows-bindgen + pub fn abi(&self) -> T::Abi { + unsafe { + match self { + Self::Owned(item) => transmute_copy(item), + Self::Borrowed(borrowed) => transmute_copy(borrowed), + } + } + } + + pub fn borrow(&self) -> Ref<'_, T> { + unsafe { transmute_copy(&self.abi()) } + } +} -- cgit v1.2.3