pub trait RepositoryItem:
Internal
+ Serialize
+ DeserializeOwned
+ Send
+ Sync
+ 'static {
type Key: ToString + Send + Sync + 'static;
const NAME: &'static str;
// Provided methods
fn type_id() -> TypeId { ... }
fn data() -> RepositoryItemData { ... }
}Expand description
This trait is used to mark types that can be stored in a repository. It should not be implemented manually; instead, users should use the crate::register_repository_item macro to register their item types.
All repository items must implement Serialize and DeserializeOwned to support
SDK-managed repositories that persist items to storage.
Required Associated Constants§
Required Associated Types§
Provided Methods§
Sourcefn data() -> RepositoryItemData
fn data() -> RepositoryItemData
Returns metadata about the repository item type.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".