pub trait EntityDescriptorConst {
type Spec: Serialize + DeserializeOwned + JsonSchema + Clone + PartialEq + Eq + Debug;
type State: Serialize + DeserializeOwned + JsonSchema + Clone + PartialEq + Eq + Debug;
const NAMESPACE: &'static str;
const NAME: &'static str;
const VERSION: &'static str;
const KIND: &'static str;
// Provided methods
fn json_schema() -> RootSchema { ... }
fn build_uri_str(name: &str) -> String { ... }
fn build_uri(name: &str) -> Result<EntityUri, EntityUriParseError> { ... }
fn type_name() -> String { ... }
fn build_type_descriptor() -> Entity<EntityTypeSpec>
where Self: JsonSchema + Sized { ... }
}Expand description
A marker trait for entity types.
Should be implementes on the struct representing the entities spec.
Required Associated Constants§
const NAMESPACE: &'static str
const NAME: &'static str
const VERSION: &'static str
const KIND: &'static str
Required Associated Types§
Sourcetype Spec: Serialize + DeserializeOwned + JsonSchema + Clone + PartialEq + Eq + Debug
type Spec: Serialize + DeserializeOwned + JsonSchema + Clone + PartialEq + Eq + Debug
Entity specification.
Sourcetype State: Serialize + DeserializeOwned + JsonSchema + Clone + PartialEq + Eq + Debug
type State: Serialize + DeserializeOwned + JsonSchema + Clone + PartialEq + Eq + Debug
The main entity state.
Provided Methods§
fn json_schema() -> RootSchema
fn build_uri_str(name: &str) -> String
fn build_uri(name: &str) -> Result<EntityUri, EntityUriParseError>
Sourcefn type_name() -> String
fn type_name() -> String
Build the name that is used for the EntityTypeSpec representing this type.
fn build_type_descriptor() -> Entity<EntityTypeSpec>where
Self: JsonSchema + Sized,
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.