pub struct HookHandle<'ph, 'f>where
'f: 'ph,{ /* private fields */ }Expand description
A hook handle.
Likes to get caught on stuff. Unhooks when dropped.
Implementations§
Source§impl<'ph, 'f> HookHandle<'ph, 'f>where
'f: 'ph,
impl<'ph, 'f> HookHandle<'ph, 'f>where
'f: 'ph,
Sourcepub fn expired(&self) -> bool
pub fn expired(&self) -> bool
If this is a timer hook, returns whether the hook has expired.
Otherwise, returns false.
§Examples
use hexchat_unsafe_plugin::{HookHandle};
/// Remove timers that have expired.
fn clean_up_timers(timers: &mut Vec<HookHandle<'_, '_>>) {
timers.retain(|timer| {
!timer.expired()
});
}Trait Implementations§
Auto Trait Implementations§
impl<'ph, 'f> Freeze for HookHandle<'ph, 'f>
impl<'ph, 'f> !RefUnwindSafe for HookHandle<'ph, 'f>
impl<'ph, 'f> !Send for HookHandle<'ph, 'f>
impl<'ph, 'f> !Sync for HookHandle<'ph, 'f>
impl<'ph, 'f> Unpin for HookHandle<'ph, 'f>
impl<'ph, 'f> !UnwindSafe for HookHandle<'ph, 'f>
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