Skip to main content

CloseHandler

Trait CloseHandler 

Source
pub trait CloseHandler<T> {
    // Required method
    fn call(&self, reason: CloseReason);
}
Expand description

Callback for the close signal of a notification.

Implemented for both Fn(CloseReason) and Fn(), so there is rarely a good reason to implement this manually.

Required Methods§

Source

fn call(&self, reason: CloseReason)

Called with the CloseReason.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<F> CloseHandler<()> for F
where F: Fn(),

Source§

impl<F> CloseHandler<CloseReason> for F
where F: Fn(CloseReason),