Skip to main content

TopicProviderAny

Trait TopicProviderAny 

Source
pub trait TopicProviderAny: Send + Sync {
    // Required method
    fn topic_any(&self, value: &dyn Any) -> Option<String>;
}
Expand description

Type-erased topic provider trait (internal)

Allows storing providers for different types in a unified collection. The concrete type is recovered via Any::downcast_ref() at runtime.

Required Methods§

Source

fn topic_any(&self, value: &dyn Any) -> Option<String>

Get the topic for a type-erased value

Returns None if the value type doesn’t match or if the provider returns None for this value.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§

Source§

impl<T, P> TopicProviderAny for TopicProviderWrapper<T, P>
where T: 'static, P: TopicProvider<T> + Send + Sync,