pub trait GffSchema {
// Required method
fn schema() -> &'static [FieldSchema];
}Expand description
Trait providing the engine-derived field schema for a GFF resource type.
Implemented by typed generics (e.g., Utw, Utc) to expose the full
engine schema - including fields not modeled as struct fields. The schema
is the single source of truth for GFF field validation.
§Example
use rakata_formats::gff_schema::{FieldSchema, GffSchema, GffType};
struct MyType;
impl GffSchema for MyType {
fn schema() -> &'static [FieldSchema] {
&[
FieldSchema {
label: "Tag",
expected_type: GffType::String,
required: false,
children: None,
constraint: None,
},
]
}
}
assert_eq!(MyType::schema().len(), 1);Required Methods§
Sourcefn schema() -> &'static [FieldSchema]
fn schema() -> &'static [FieldSchema]
Returns the root field schema for this GFF resource type.
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.