pub struct ReloadHandle<T> { /* private fields */ }Expand description
A handle for replacing the bot’s handler list at runtime without disconnecting from IRC.
Obtain one via internal::make_handler_set + ReloadHandle::new when
using the lower-level API, or use the generated main_loop() which wires
up SIGHUP automatically.
ReloadHandle is Clone — clones share the same underlying HandlerSet.
Implementations§
Source§impl<T> ReloadHandle<T>
impl<T> ReloadHandle<T>
Sourcepub fn new(handlers: HandlerSet<T>) -> Self
pub fn new(handlers: HandlerSet<T>) -> Self
Create a ReloadHandle from a HandlerSet.
Sourcepub fn reload(&self, new_handlers: Vec<HandlerEntry<T>>)
pub fn reload(&self, new_handlers: Vec<HandlerEntry<T>>)
Atomically replace the running bot’s handler list.
Takes effect on the next incoming IRC message; the connection is not interrupted.
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for ReloadHandle<T>
impl<T> RefUnwindSafe for ReloadHandle<T>
impl<T> Send for ReloadHandle<T>
impl<T> Sync for ReloadHandle<T>
impl<T> Unpin for ReloadHandle<T>
impl<T> UnsafeUnpin for ReloadHandle<T>
impl<T> UnwindSafe for ReloadHandle<T>
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