type_registry/logical/registered.rs
1use std::any::Any;
2use crate::logical::registration::Registration;
3use crate::logical::registry::Registry;
4
5/// Trait which marks a type as registered with a particular [registry](Registry).
6pub unsafe trait Registered<R: Registry + ?Sized>: Any {
7 /// Register the type with the [registry](Registry). Should internally use the
8 /// [registration! macro (click for example)](crate::registration).
9 fn register() -> Registration<R, Self>;
10
11 /// Statically allocate and return the [information](crate::logical::TypeInfo) about the registered type.
12 fn type_info() -> &'static <R as Registry>::TypeInfo;
13}