pub struct EventGuard { /* private fields */ }Expand description
EventGuard
Simple RAII class to set an event and automatically clear it when it goes out of scope
§Examples
use win_events::{EventGuard, ManualResetEvent};///
let event = ManualResetEvent::new(false);///
assert!(!event.is_set());///
let event_guard = EventGuard::new(&event);
assert!(event.is_set());
drop(event_guard);
assert!(!event.is_set());
Implementations§
Source§impl EventGuard
impl EventGuard
pub fn new(event: &dyn Event) -> EventGuard
Trait Implementations§
Auto Trait Implementations§
impl Freeze for EventGuard
impl !RefUnwindSafe for EventGuard
impl Send for EventGuard
impl Sync for EventGuard
impl Unpin for EventGuard
impl !UnwindSafe for EventGuard
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