pub struct ComGuard { /* private fields */ }Expand description
RAII guard for COM initialization. Calls CoUninitialize on drop.
§Threading
This guard initializes COM in single-threaded apartment (STA) mode,
which is required by the Windows Shell context menu interfaces. All context
menu operations must happen on the same thread that created the ComGuard.
ComGuard is intentionally not Send or Sync — moving it to another
thread would violate STA rules.
§Example
let _com = win_context_menu::init_com()?;
// COM is active for the lifetime of `_com`Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ComGuard
impl RefUnwindSafe for ComGuard
impl !Send for ComGuard
impl !Sync for ComGuard
impl Unpin for ComGuard
impl UnsafeUnpin for ComGuard
impl UnwindSafe for ComGuard
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more