pub trait NotificationTarget: 'static {
// Required method
fn cast(notification: &dyn Notification) -> Option<&Self>;
}Expand description
A type a NotificationListener<T> can listen for: a concrete Notification, or a
family of them named by a trait object (dyn ScrollNotification).
Dart’s notification is T; a family answers it through a vtable slot on
Notification, a concrete type through Notification::as_any.
Required Methods§
Sourcefn cast(notification: &dyn Notification) -> Option<&Self>
fn cast(notification: &dyn Notification) -> Option<&Self>
The notification as a T, when it is one.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".