Struct hexchat_unsafe_plugin::HookHandle
source · [−]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
sourceimpl<'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> !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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more