1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
use *;
/// A storage cell for the inner non-delegating `IInspectable` produced by COM aggregation
/// (composition).
///
/// Laid out as `#[repr(transparent)]` over `Option<IInspectable>` so callers can transmute
/// a `&mut ComposeBase` into a `&mut Option<IInspectable>`. The wrapper exists to satisfy
/// `Send`/`Sync` for objects that embed it as a field but never participate in aggregation.
///
/// # Safety contract
///
/// The slot is written exactly once, during the call to [`Compose::compose`], before the
/// outer object is shared. After that point it is only read (during `IUnknown::QueryInterface`
/// fall-through) through a shared reference. Any object using this slot must be agile or
/// otherwise guarantee that the inner `IInspectable` may be observed from multiple threads.
;
// SAFETY: see the type-level safety contract above.
unsafe
// SAFETY: see the type-level safety contract above.
unsafe
/// A trait used to support aggregation (composition) of WinRT runtime classes.
///
/// Composable WinRT factory methods take an "outer" `IInspectable` (the controlling
/// unknown) and an out-pointer for the "inner" non-delegating `IInspectable`. When a Rust
/// implementation type derives from a composable WinRT class it must hand the runtime an
/// outer `IInspectable` and provide a slot for the runtime to write back the inner.
///
/// The `windows-implement` proc macro emits an implementation of this trait for every type
/// marked with `#[implement(...)]`.