pub struct ComGuard { /* private fields */ }Expand description
Drop guard for COM thread initialization.
Calling ComGuard::new initializes COM in Multi-Threaded Apartment
(MTA) mode. When the guard is dropped, CoUninitialize is called
automatically.
§Thread Safety
ComGuard is intentionally !Send and !Sync. COM initialization
is per-thread — the guard must be created and dropped on the same
OS thread. This is enforced at compile time.
§Examples
let _guard = ComGuard::new()?;
// ... COM operations ...
// CoUninitialize called automatically on dropImplementations§
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