pub trait SchemaPossibleTypes<'a>: Sized {
// Required methods
fn add_possible_type(&mut self, ctx: &'a ASTContext, object: &'a str);
fn get_possible_types(&self) -> Vec<'a, &'a str>;
// Provided methods
fn get_possible_type(&self, name: &'a str) -> Option<&'a str> { ... }
fn is_possible_type(&self, schema_object: &SchemaObject<'a>) -> bool { ... }
}Expand description
Generic trait for any schema type that implements interfaces
Required Methods§
Sourcefn add_possible_type(&mut self, ctx: &'a ASTContext, object: &'a str)
fn add_possible_type(&mut self, ctx: &'a ASTContext, object: &'a str)
Add a new SchemaObject to the list of possible types
Sourcefn get_possible_types(&self) -> Vec<'a, &'a str>
fn get_possible_types(&self) -> Vec<'a, &'a str>
Get list of possible SchemaObject types
Provided Methods§
Sourcefn get_possible_type(&self, name: &'a str) -> Option<&'a str>
fn get_possible_type(&self, name: &'a str) -> Option<&'a str>
Get a specific possible type by name if it exists on the type
Sourcefn is_possible_type(&self, schema_object: &SchemaObject<'a>) -> bool
fn is_possible_type(&self, schema_object: &SchemaObject<'a>) -> bool
Checks whether given [ObjectType] is a possible subtype
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.