Skip to main content

ExtensionData

Trait ExtensionData 

Source
pub trait ExtensionData:
    Any
    + Debug
    + Send
    + Sync {
    // Required method
    fn as_any(&self) -> &dyn Any;
}
Expand description

Trait for typed data stored in DisplayCapabilities::extension_data by custom handlers.

A blanket implementation covers any type that is Any + Debug + Send + Sync, so consumers do not need to implement this trait manually — #[derive(Debug)] on a Send + Sync type is sufficient.

Required Methods§

Source

fn as_any(&self) -> &dyn Any

Returns self as &dyn Any to enable downcasting.

Implementors§

Source§

impl<T: Any + Debug + Send + Sync> ExtensionData for T

Available on crate features alloc or std only.