pub trait TableObject:
Debug
+ Any
+ Send
+ Sync
+ Serialize {
// Required method
fn as_any(&self) -> &dyn Any;
}Expand description
Object-safe face of a runtime-registered table-section value.
Registered types must be owned ('static) because the dyn Any downcast
path requires it. See the module docs for details.
Implemented automatically via the blanket impl for any T satisfying the
supertraits; you do not need to write this by hand.
Required Methods§
Implementations§
Source§impl dyn TableObject
impl dyn TableObject
Sourcepub fn downcast_ref<T: Any>(&self) -> Option<&T>
pub fn downcast_ref<T: Any>(&self) -> Option<&T>
Downcast a registered table section to its concrete type T.
Works for Box<dyn TableObject> (it derefs to the trait object) under
every feature configuration.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".