Debian Codegraph @

third_party/rust/windows-core/src/windows.rs

raw
1 mod agile_reference;
2 pub use agile_reference::*;
3
4 mod array;
5 pub use array::*;
6
7 #[cfg(feature = "std")]
8 mod event;
9 #[cfg(feature = "std")]
10 pub use event::*;
11
12 mod handles;
13 pub use handles::*;
14
15 mod variant;
16 pub use variant::*;
17
18 pub use windows_strings::*;
19
20 /// Attempts to load the factory object for the given WinRT class.
21 /// This can be used to access COM interfaces implemented on a Windows Runtime class factory.
22 pub fn factory<C: RuntimeName, I: Interface>() -> Result<I> {
23 imp::factory::<C, I>()
24 }
25
26 impl Param<PCWSTR> for &BSTR {
27 unsafe fn param(self) -> ParamValue<PCWSTR> {
28 ParamValue::Owned(PCWSTR(self.as_ptr()))
29 }
30 }
31
32 impl Param<PCWSTR> for &HSTRING {
33 unsafe fn param(self) -> ParamValue<PCWSTR> {
34 ParamValue::Owned(PCWSTR(self.as_ptr()))
35 }
36 }
37
38 impl Param<PCWSTR> for PWSTR {
39 unsafe fn param(self) -> ParamValue<PCWSTR> {
40 ParamValue::Owned(PCWSTR(self.0))
41 }
42 }
43
44 impl Param<PCSTR> for PSTR {
45 unsafe fn param(self) -> ParamValue<PCSTR> {
46 ParamValue::Owned(PCSTR(self.0))
47 }
48 }
49
50 impl RuntimeType for HSTRING {
51 const SIGNATURE: imp::ConstBuffer = imp::ConstBuffer::from_slice(b"string");
52 }
53
54 impl TypeKind for PWSTR {
55 type TypeKind = CopyType;
56 }
57
58 impl TypeKind for PSTR {
59 type TypeKind = CopyType;
60 }
61
62 impl TypeKind for PCWSTR {
63 type TypeKind = CopyType;
64 }
65
66 impl TypeKind for PCSTR {
67 type TypeKind = CopyType;
68 }
69
70 impl TypeKind for HSTRING {
71 type TypeKind = CloneType;
72 }
73
74 impl TypeKind for BSTR {
75 type TypeKind = CloneType;
76 }