Skip to main content

SchemaLookup

Trait SchemaLookup 

Source
pub trait SchemaLookup {
    // Required methods
    fn type_name(&self, schema_id: u64) -> Option<&str>;
    fn field_names(&self, schema_id: u64) -> Option<Vec<&str>>;
}
Expand description

Trait for looking up schema metadata from a schema_id.

Implemented by TypeSchemaRegistry in shape-runtime. This abstraction lets shape-value convert TypedObjects to ExternalValue without depending on shape-runtime.

Required Methods§

Source

fn type_name(&self, schema_id: u64) -> Option<&str>

Get the type name for a schema_id, or None if unknown.

Source

fn field_names(&self, schema_id: u64) -> Option<Vec<&str>>

Get ordered field names for a schema_id, or None if unknown.

Implementors§